Skip to content

Commit

Permalink
Revert 30152b4 because its test is not working some environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 11, 2020
1 parent 04789df commit ea8bd2e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
2 changes: 1 addition & 1 deletion lib/webrick/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def initialize(config={}, default=Config::General)
@logger.info("ruby #{rubyv}")

@listeners = []
@shutdown_pipe = @config[:ShutdownPipe]
@shutdown_pipe = nil
unless @config[:DoNotListen]
raise ArgumentError, "Port must an integer" unless @config[:Port].to_s == @config[:Port].to_i.to_s

Expand Down
27 changes: 0 additions & 27 deletions test/webrick/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,33 +161,6 @@ def <<(msg)
}
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
begin
if server_threads.last.status
pipe.last.puts('')
break
end
rescue IOError
nil
end
end
assert_join_threads(server_threads)
end

def test_port_numbers
config = {
:BindAddress => '0.0.0.0',
Expand Down

0 comments on commit ea8bd2e

Please sign in to comment.