Skip to content

Commit

Permalink
test: increase timeouts in on_shutdown tests
Browse files Browse the repository at this point in the history
I got four fails on the given tests in a row on debug-asan job in CI for
tarantool-ee.

It seems, tarantool-ee is more sensitive to small timeouts, when the
address sanitizer slows down the execution. Or I'm just lucky.

Anyway, the given tests don't really need small timeouts: increasing it
doesn't break any test logic, doesn't increase duration of the test in a
successful case and doesn't increase it in case of a failure.

The tests are more stable after the change: I verified it locally by
running each of the tests in parallel many times on tarantool built with
enabled address sanitizer.

See the following commits for details about the given test cases and the
problems behind.

* commit 1fcfb8c ("app: start init script event loop explicitly")
* commit 786eb2a ("main: don't break graceful shutdown on init
  script exit")

Follows up #9266
Follows up #9411

NO_DOC=test adjustment
NO_CHANGELOG=see NO_DOC

(cherry picked from commit dfca3c6)
  • Loading branch information
Totktonada authored and sergepetrenko committed Feb 19, 2024
1 parent f641f06 commit 1604a97
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1604a97

Please sign in to comment.