From 1f4726da5fdc8a4147d8649f6aa9c56cd906ffc4 Mon Sep 17 00:00:00 2001 From: John W Higgins Date: Fri, 25 Sep 2020 13:46:35 -0700 Subject: [PATCH] Refix test_shutdown_pipe As mentioned in #44 and #54 - there continues to be issues with regards to the server startup with regards to this test. WEBrick::GenericServer#stop swallows an IOError internally - so the fix here is to swallow the error during the test and to retry. --- test/webrick/test_server.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index abe1ecca..a7f11399 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -176,9 +176,13 @@ def test_shutdown_pipe :Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN)) server_threads << Thread.start { server.start } sleep 0.1 until server.status == :Running || !server_threads.last.status - if server_threads.last.status - pipe.last.puts('') - break + begin + if server_threads.last.status + pipe.last.puts('') + break + end + rescue IOError + nil end end assert_join_threads(server_threads)