1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

let's say that a minor thread contention issue in the test suite is not a failure on jruby. on MRI i can determine the scheduling via sleep but jruby does what it wants.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@785 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
evanweaver 2007-10-27 00:58:48 +00:00
parent 3bdf6c88b5
commit 304dd1ea90
2 changed files with 5 additions and 3 deletions

View file

@ -233,7 +233,7 @@ module Mongrel
# that much longer.
def graceful_shutdown
while reap_dead_workers("shutdown") > 0
STDERR.print "Waiting for #{@workers.list.length} requests to finish, could take #{@timeout + @throttle} seconds."
STDERR.puts "Waiting for #{@workers.list.length} requests to finish, could take #{@timeout + @throttle} seconds."
sleep @timeout / 10
end
end

View file

@ -47,7 +47,7 @@ class WebServerTest < Test::Unit::TestCase
end
def do_test(string, chunk, close_after=nil)
def do_test(string, chunk, close_after=nil, shutdown_delay=0)
# Do not use instance variables here, because it needs to be thread safe
socket = TCPSocket.new("127.0.0.1", 9998);
request = StringIO.new(string)
@ -62,7 +62,9 @@ class WebServerTest < Test::Unit::TestCase
sleep 1
end
end
sleep(shutdown_delay)
socket.write(" ") # Some platforms only raise the exception on attempted write
socket.flush
end
def test_trickle_attack
@ -85,7 +87,7 @@ class WebServerTest < Test::Unit::TestCase
redirect_test_io do
long = "GET /test HTTP/1.1\r\n" + ("X-Big: stuff\r\n" * 15000) + "\r\n"
assert_raises Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Errno::EINVAL do
do_test(long, long.length/2)
do_test(long, long.length/2, 10)
end
end
end