about summary refs log tree commit homepage
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_configurator.rb2
-rw-r--r--test/unit/test_upload.rb19
2 files changed, 9 insertions, 12 deletions
diff --git a/test/unit/test_configurator.rb b/test/unit/test_configurator.rb
index f836647..bcdd2f5 100644
--- a/test/unit/test_configurator.rb
+++ b/test/unit/test_configurator.rb
@@ -53,7 +53,6 @@ class TestConfigurator < Test::Unit::TestCase
     cfg = Unicorn::Configurator.new(:use_defaults => true)
     assert_nothing_raised { cfg.commit!(self) }
     Unicorn::Configurator::DEFAULTS.each do |key,value|
-      next if key == :stream_input
       assert_equal value, instance_variable_get("@#{key.to_s}")
     end
   end
@@ -65,7 +64,6 @@ class TestConfigurator < Test::Unit::TestCase
     @logger = nil
     Unicorn::Configurator::DEFAULTS.each do |key,value|
       next if skip.include?(key)
-      next if key == :stream_input
       assert_equal value, instance_variable_get("@#{key.to_s}")
     end
     assert_nil @logger
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 37baa30..dad5825 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -142,20 +142,19 @@ class UploadTest < Test::Unit::TestCase
   end
 
   def test_put_excessive_overwrite_closed
-    start_server(lambda { |env| [ 200, @hdr, [] ] })
+    start_server(lambda { |env|
+      while env['rack.input'].read(65536); end
+      [ 200, @hdr, [] ]
+    })
     sock = TCPSocket.new(@addr, @port)
     buf = ' ' * @bs
     sock.syswrite("PUT / HTTP/1.0\r\nContent-Length: #{length}\r\n\r\n")
-    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
+
+    @count.times { sock.syswrite(buf) }
+    assert_raise(Errno::ECONNRESET, Errno::EPIPE) do
+      ::Unicorn::Const::CHUNK_SIZE.times { sock.syswrite(buf) }
     end
+    assert_equal "HTTP/1.1 200 OK\r\n", sock.gets
   end
 
   # Despite reading numerous articles and inspecting the 1.9.1-p0 C