diff --git a/test/openssl/test_ssl_session.rb b/test/openssl/test_ssl_session.rb index c3bfdac7b9..d04ebe2717 100644 --- a/test/openssl/test_ssl_session.rb +++ b/test/openssl/test_ssl_session.rb @@ -351,9 +351,12 @@ __EOS__ ssl.connect last_client_session = ssl.session ssl.close - Thread.pass # try to ensure server calls callbacks - assert(called.delete(:new)) - assert(called.delete(:remove)) + timeout(5) do + Thread.pass until called.key?(:new) + assert(called.delete(:new)) + Thread.pass until called.key?(:remove) + assert(called.delete(:remove)) + end end end assert(called[:get1])