diff --git a/test/box/push.result b/test/box/push.result index 8919a3f5bd898c42d9478bb9b209a445a43a2a5c..aebcb7501a8a5b524f3cf1be02b21e60801cd883 100644 --- a/test/box/push.result +++ b/test/box/push.result @@ -501,18 +501,24 @@ s:drop() -- gh-3859: box.session.push() succeeds even after the connection -- is closed. -- +chan_func = fiber.channel() +--- +... chan_push = fiber.channel() --- ... chan_disconnected = fiber.channel() --- ... +on_disconnect = box.session.on_disconnect(function() chan_disconnected:put(true) end) +--- +... test_run:cmd("setopt delimiter ';'") --- - true ... function do_long_and_push() - box.session.on_disconnect(function() chan_disconnected:put(true) end) + chan_func:put(true) chan_push:get() ok, err = box.session.push(100) chan_push:put(err) @@ -532,6 +538,10 @@ box.schema.user.grant('guest', 'execute', 'function', 'do_long_and_push') f = fiber.create(function() c:call('do_long_and_push') end) --- ... +chan_func:get() +--- +- true +... c:close() --- ... @@ -550,3 +560,6 @@ chan_push:get() box.schema.func.drop('do_long_and_push') --- ... +box.session.on_disconnect(nil, on_disconnect) +--- +... diff --git a/test/box/push.test.lua b/test/box/push.test.lua index 514c08b3e121df72b38c729f7c9a33a9f1024dc9..7ae6f4a8638bcc2424e486779003ff82e91f8fe4 100644 --- a/test/box/push.test.lua +++ b/test/box/push.test.lua @@ -242,11 +242,13 @@ s:drop() -- gh-3859: box.session.push() succeeds even after the connection -- is closed. -- +chan_func = fiber.channel() chan_push = fiber.channel() chan_disconnected = fiber.channel() +on_disconnect = box.session.on_disconnect(function() chan_disconnected:put(true) end) test_run:cmd("setopt delimiter ';'") function do_long_and_push() - box.session.on_disconnect(function() chan_disconnected:put(true) end) + chan_func:put(true) chan_push:get() ok, err = box.session.push(100) chan_push:put(err) @@ -255,8 +257,10 @@ test_run:cmd("setopt delimiter ''"); box.schema.func.create('do_long_and_push') box.schema.user.grant('guest', 'execute', 'function', 'do_long_and_push') f = fiber.create(function() c:call('do_long_and_push') end) +chan_func:get() c:close() chan_disconnected:get() chan_push:put(true) chan_push:get() box.schema.func.drop('do_long_and_push') +box.session.on_disconnect(nil, on_disconnect)