diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-25 07:33:20 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-25 07:33:25 +0900 |
commit | c5960d51d13a002b02d18ad328eb7d5b8937805d (patch) | |
tree | c5d938b45c5d0dbfdbce2d025a1d6f538d47224f | |
parent | 38385d28dff349dee0913572f976114292e98ac6 (diff) | |
download | ruby-c5960d51d13a002b02d18ad328eb7d5b8937805d.tar.gz |
Revert "[ruby/webrick] Fix shutdown_pipe test issue"
This reverts commit b8fdd38b2e01abcfd4cc8d007a3b3afb285f5ddb.
-rw-r--r-- | test/webrick/test_server.rb | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index abe1ecca39..aa40a72b0c 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -162,26 +162,15 @@ class TestWEBrickServer < Test::Unit::TestCase end def test_shutdown_pipe - loop_count = 0 - server_threads = [] - loop do - loop_count += 1 - break if loop_count == 11 - - pipe = IO.pipe - server = WEBrick::GenericServer.new( - :ShutdownPipe => pipe, - :BindAddress => '0.0.0.0', - :Port => 0, - :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 - end - end - assert_join_threads(server_threads) + pipe = IO.pipe + server = WEBrick::GenericServer.new( + :ShutdownPipe => pipe, + :BindAddress => '0.0.0.0', + :Port => 0, + :Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN)) + server_thread = Thread.start { server.start } + pipe.last.puts('') + assert_join_threads([server_thread]) end def test_port_numbers |