Skip to content
Snippets Groups Projects
Commit 40251c60 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

test: fix box/push.test sporadic hang

This patch fixes the following test failure:

 | --- box/push.result	Thu Jan 24 13:10:04 2019
 | +++ var/001_box/push.result	Thu Jan 24 13:13:08 2019
 | @@ -536,17 +536,3 @@
 |  ---
 |  ...
 |  chan_disconnected:get()
 | ----
 | -- true
 | -...
 | -chan_push:put(true)
 | ----
 | -- true
 | -...
 | -chan_push:get()
 | ----
 | -- Session is closed
 | -...
 | -box.schema.func.drop('do_long_and_push')
 | ----
 | -...

The problem occurs because the main fiber may close the connection
before do_long_and_push sets the session.on_disconnect trigger, in
which case chan_disconnected:get() will never return. Fix this by
setting the trigger in the main fiber and adding another channel
to wait for do_long_and_push function to start. Also, don't forget
to clear the trigger once the test is complete.

Fixes commit 43af2de2 ("session: outdate a session of a closed
connection").

Closes #3947
parent cde94067
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment