diff --git a/test/app-luatest/gh_9411_fix_graceful_shutdown_break_on_script_exit_test.lua b/test/app-luatest/gh_9411_fix_graceful_shutdown_break_on_script_exit_test.lua index fa86badaf4c43c7b825636384934a6611ca8f649..90bf1fbd9bd534c3ff837744ce9a49576761ec09 100644 --- a/test/app-luatest/gh_9411_fix_graceful_shutdown_break_on_script_exit_test.lua +++ b/test/app-luatest/gh_9411_fix_graceful_shutdown_break_on_script_exit_test.lua @@ -33,7 +33,16 @@ g.test = function() stderr = popen.opts.DEVNULL}) assert(handle, err) g.handle = handle - local output, err = handle:read({timeout = 3}) + -- NB: Don't guess a good timeout, just use 60 seconds as + -- something that is definitely less than default test timeout + -- (110 seconds), but large enough to perform an action that + -- usually takes a fraction of a second. + -- + -- The bad case doesn't stuck the test case anyway: if the + -- child process doesn't call an on_shutdown trigger, the + -- process exits without output and we get EOF (an empty + -- string) here. + local output, err = handle:read({timeout = 60}) assert(output, err) t.assert_equals(output, 'shutdown callback finished\n') local status = handle:wait() diff --git a/test/box-luatest/gh_9266_fix_on_shutdown_and_osexit_from_cmd_expr_test.lua b/test/box-luatest/gh_9266_fix_on_shutdown_and_osexit_from_cmd_expr_test.lua index 15152652add449fac1d28889ac39e1e44ebf0ab3..9cf2c7633c955ed1a007886ab7897a307af7b453 100644 --- a/test/box-luatest/gh_9266_fix_on_shutdown_and_osexit_from_cmd_expr_test.lua +++ b/test/box-luatest/gh_9266_fix_on_shutdown_and_osexit_from_cmd_expr_test.lua @@ -25,7 +25,16 @@ g.test = function() stderr = popen.opts.DEVNULL}) assert(handle, err) g.handle = handle - local output, err = handle:read({timeout = 3}) + -- NB: Don't guess a good timeout, just use 60 seconds as + -- something that is definitely less than default test timeout + -- (110 seconds), but large enough to perform an action that + -- usually takes a fraction of a second. + -- + -- The bad case doesn't stuck the test case anyway: if the + -- child process doesn't call an on_shutdown trigger, the + -- process exits without output and we get EOF (an empty + -- string) here. + local output, err = handle:read({timeout = 60}) assert(output, err) t.assert_equals(output, "hello\n") local status = handle:wait()