diff options
Diffstat (limited to 'test/unit/test_upload.rb')
-rw-r--r-- | test/unit/test_upload.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb index 4c0790f..b69ba4e 100644 --- a/test/unit/test_upload.rb +++ b/test/unit/test_upload.rb @@ -119,9 +119,15 @@ class UploadTest < Test::Unit::TestCase sock = TCPSocket.new(@addr, @port) buf = ' ' * @bs sock.syswrite("PUT / HTTP/1.0\r\nContent-Length: #{length}\r\n\r\n") - @count.times { sock.syswrite(buf) } - assert_raise(Errno::ECONNRESET, Errno::EPIPE) do - ::Unicorn::Const::CHUNK_SIZE.times { sock.syswrite(buf) } + if Unicorn::HttpRequest::DEFAULTS['unicorn.stream_input'] + assert_raise(Errno::ECONNRESET, Errno::EPIPE) do + @count.times { sock.syswrite(buf) } + end + else + @count.times { sock.syswrite(buf) } + assert_raise(Errno::ECONNRESET, Errno::EPIPE) do + ::Unicorn::Const::CHUNK_SIZE.times { sock.syswrite(buf) } + end end end |