From ede831d317c3a5ba02f202a7daf387742ddbfeb6 Mon Sep 17 00:00:00 2001 From: Vladimir Davydov <vdavydov@tarantool.org> Date: Thu, 9 Jun 2022 18:08:07 +0300 Subject: [PATCH] test: set shutdown timeout to infinity for default luatest instance With the default shutdown timeout of 3 seconds, a test that leaves behind asynchronous requests would still pass, but it would take longer to finish, because the server instance started by Tarantool would have to wait for the dangling requests to complete. Setting the timeout to infinity will result in a hang, making us fix the test. Infinite timeout is also good for catching bugs like #7225 and #7256. We don't set the timeout for diff and TAP tests because those are deprecated and shouldn't be used for writing new tests. Nevertheless, I manually checked that none of them hangs if the timeout is set to infinity. Closes #6820 NO_DOC=test NO_CHANGELOG=test --- test/instances/default.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/instances/default.lua b/test/instances/default.lua index 5e5287b235..31a720da45 100755 --- a/test/instances/default.lua +++ b/test/instances/default.lua @@ -3,6 +3,8 @@ local fun = require('fun') local json = require('json') +local TIMEOUT_INFINITY = 500 * 365 * 86400 + local function default_cfg() return { work_dir = os.getenv('TARANTOOL_WORKDIR'), @@ -29,6 +31,13 @@ local function box_cfg(cfg) return fun.chain(default_cfg(), env_cfg(), cfg or {}):tomap() end +-- Set the shutdown timeout to infinity so that we can catch tests that leave +-- asynchronous requests. If we used the default timeout of 3 seconds, such a +-- test would still pass, but it would slow down the overall test run, because +-- the server would take longer to stop. Setting the timeout to infinity makes +-- such bad tests hang and fail. +box.ctl.set_on_shutdown_timeout(TIMEOUT_INFINITY) + box.cfg(box_cfg()) box.schema.user.grant('guest', 'super', nil, nil, {if_not_exists = true}) -- GitLab