nic-6443 commented on code in PR #12836:
URL: https://github.com/apache/apisix/pull/12836#discussion_r2644555823
##########
t/APISIX.pm:
##########
@@ -380,9 +380,9 @@ _EOC_
location /exec_request {
content_by_lua_block {
local shell = require("resty.shell")
- local ok, stdout, stderr, reason, status = shell.run([[
$exec_snippet ]], $stdin, @{[$timeout*1000]}, $max_size)
+ local ok, stdout, stderr, reason, status = shell.run([[
$exec_snippet ]], $stdin, @{[($timeout-1)*1000]}, $max_size)
if not ok then
- ngx.log(ngx.WARN, "failed to execute the script with
status: " .. status .. ", reason: " .. reason .. ", stderr: " .. stderr)
+ ngx.log(ngx.WARN, "failed to execute the script with
status: " .. (status or "nil ") .. ", reason: " .. (reason or "nil") .. ",
stderr: " .. (stderr or "nil"))
Review Comment:
Please manually simulate a timeout error locally, such as adding sleep in a
test case executed by pnpm. I want to confirm that after making this change,
the output of external programs like pnpm is indeed obtained when the timeout
is triggered. Then put the test results in the PR description.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]