Skip to content

Commit

Permalink
test: dont os.exit() in session disconnect trigger
Browse files Browse the repository at this point in the history
We are going to make Tarantool shutdown graceful. Particularly for
iproto graceful shutdown we wait while all connections are finished.
On connection disconnect session disconnect triggers are invoked. If
trigger hangs then graceful shutdown will hang too. And os.exit() do
hang, it sleeps forever.

So 110-disconnect-trigger-check.t test now hangs with iproto graceful
shutdown patch.

Making os.exit() from disconnect trigger does not seem as a product
case. So let's just change the test not to use os.exit().

Required for full-ci pass of tarantool/tarantool#9457
  • Loading branch information
nshy authored and LeonidVas committed Dec 15, 2023
1 parent f900aeb commit e99ce45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions t/110-disconnect-trigger-check.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test:plan(2)
-- Verify that _queue_taken space is empty.
local function check_result()
if tube == nil then
os.exit(1)
return
end

-- tube:drop() is most simple way to check that _queue_taken
Expand All @@ -26,7 +26,6 @@ local function check_result()
test:is(res, true, 'tube:drop() result is true')

tnt.finish()
os.exit(test:check() and 0 or 1)
end

-- Yield in queue's on_disconnect trigger (which handles a client
Expand Down Expand Up @@ -92,7 +91,7 @@ local function test_lost_session_id_after_yield()
-- session' error in the _on_consumer_disconnect and so the
-- second on_disconnect trigger (check_result) will not be
-- fired.
os.exit(1)
os.exit(test:check() and 0 or 1)
end

test_lost_session_id_after_yield()
Expand Down

0 comments on commit e99ce45

Please sign in to comment.