Skip to content

Commit

Permalink
Make server_instance.lua work for Tarantool < 2.8.1
Browse files Browse the repository at this point in the history
The `box.ctl.set_on_shutdown_timeout()` function is available only since
Tarantool 2.8.0-139-g357f15517. This patch makes the server_instance.lua
script compatible with older Tarantool versions.
  • Loading branch information
ylobankov committed Dec 6, 2022
1 parent 1387aa8 commit cb28d93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Make the internal server_instance.lua script compatible with Tarantool
versions < 2.8.0-139-g357f15517.
- Extend `server.lua` API:
* Update parameters of the `Server:new()` function:
- The `alias` parameter defaults to 'server'.
Expand Down
4 changes: 3 additions & 1 deletion luatest/server_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ end
-- requests. With the default timeout of 3 seconds, such tests would still pass,
-- but 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)
if type(box.ctl.set_on_shutdown_timeout) == 'function' then
box.ctl.set_on_shutdown_timeout(TIMEOUT_INFINITY)
end

local run_before_box_cfg = os.getenv('TARANTOOL_RUN_BEFORE_BOX_CFG')
if run_before_box_cfg then
Expand Down

0 comments on commit cb28d93

Please sign in to comment.