1
0
Fork 0
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:
Evan Phoenix 2012-09-10 08:35:50 -07:00
parent e9a0b5e615
commit 1a19f79be7

View file

@ -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"