about summary refs log tree commit homepage
path: root/test/http.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-02-25 11:41:00 +0000
committerEric Wong <normalperson@yhbt.net>2012-02-25 11:51:02 +0000
commite5991473a91697a4924530b87051c764e538ce15 (patch)
tree05981669a42de64cc0a35cacd44fe6c2aeab1eeb /test/http.rb
parent025e09f5be3d1a42a5f585f80b18d5947da5e766 (diff)
downloadcmogstored-e5991473a91697a4924530b87051c764e538ce15.tar.gz
By going into single-threaded mode, we can drastically simplify our
shutdown sequence to avoid race conditions.  This also allows us
to not have additional overhead during normal runtime: as all the
shutdown-specific logic is isolated to only a few portions of
the code.

Like all graceful shutdown schemes, this is one is still vulnerable to
race conditions due to network latency, but this one should be no worse
than any other server.  Fortunately all requests we service are
idempotent.
Diffstat (limited to 'test/http.rb')
-rw-r--r--test/http.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/http.rb b/test/http.rb
index f5a19de..ad21af4 100644
--- a/test/http.rb
+++ b/test/http.rb
@@ -74,6 +74,7 @@ class TestHTTP < Test::Unit::TestCase
   end
 
   def test_get_huge
+    return unless IO.respond_to?(:copy_stream)
     Dir.mkdir("#@tmpdir/dev666")
     big = 100 * 1024 * 1024
     File.open("#@tmpdir/dev666/sparse-file.fid", "w") do |fp|
@@ -84,7 +85,6 @@ class TestHTTP < Test::Unit::TestCase
     buf = @client.readpartial(600)
     _, body = buf.split(/\r\n\r\n/, 2)
 
-    return unless IO.respond_to?(:copy_stream)
     bytes = IO.copy_stream(@client, "/dev/null")
     assert_equal bytes + body.bytesize, big
   end