Maintenance: Improved stability of the CI by gracefully stoping the websocket server instead of killing the thread which results in a blocked port sometimes.

This commit is contained in:
Mantas Masalskis 2019-09-16 12:29:04 +02:00 committed by Thorsten Eckel
parent 1c63e96675
commit 6000b9f5c1

View file

@ -19,6 +19,10 @@ RSpec.configure do |config|
next if !server_required
Thread.kill(websocket_server)
# returns immediately and thread may be still shutting down
EventMachine.stop_event_loop
# give thread time to terminate
sleep 0.01 while websocket_server.status
end
end