mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Add test for hot restart with workers
This commit is contained in:
parent
e9a0b5e615
commit
1a19f79be7
1 changed files with 26 additions and 0 deletions
|
@ -111,6 +111,32 @@ class TestIntegration < Test::Unit::TestCase
|
|||
assert_equal "Hello World", s.read.split("\r\n").last
|
||||
end
|
||||
|
||||
def test_restart_closes_keepalive_sockets_workers
|
||||
server("-q -w 2 test/hello.ru")
|
||||
|
||||
s = TCPSocket.new "localhost", @tcp_port
|
||||
s << "GET / HTTP/1.1\r\n\r\n"
|
||||
true until s.gets == "\r\n"
|
||||
|
||||
s.readpartial(20)
|
||||
signal :USR2
|
||||
|
||||
true while @server.gets =~ /Ctrl-C/
|
||||
sleep 1
|
||||
|
||||
s.write "GET / HTTP/1.1\r\n\r\n"
|
||||
|
||||
assert_raises Errno::ECONNRESET do
|
||||
Timeout.timeout(2) do
|
||||
s.read(2)
|
||||
end
|
||||
end
|
||||
|
||||
s = TCPSocket.new "localhost", @tcp_port
|
||||
s << "GET / HTTP/1.0\r\n\r\n"
|
||||
assert_equal "Hello World", s.read.split("\r\n").last
|
||||
end
|
||||
|
||||
def test_bad_query_string_outputs_400
|
||||
server "-q test/hello.ru 2>&1"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue