about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-03-15 23:46:42 +0000
committerEric Wong <normalperson@yhbt.net>2012-03-15 23:47:33 +0000
commit48341457301239725eddc585f712efd784c54345 (patch)
tree595ae54faac7b737fa6385594b4c92c017a8ea2e
parent4684050a21fb7a1ac27becf3936373c48024d7cb (diff)
downloadcmogstored-48341457301239725eddc585f712efd784c54345.tar.gz
No need to repeatedly yield (due to small skbs) because
we already checked for graceful shutdown.
-rw-r--r--test/graceful_quit.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/graceful_quit.rb b/test/graceful_quit.rb
index 42a92d5..72f8db7 100644
--- a/test/graceful_quit.rb
+++ b/test/graceful_quit.rb
@@ -85,16 +85,18 @@ class TestGracefulQuit < Test::Unit::TestCase
       assert_match(expect, ps_output)
     end
 
+                errs = [ Errno::ECONNREFUSED ]
+    errs << Errno::EINVAL if RUBY_PLATFORM =~ /freebsd/
     t_yield
-    assert_raises(Errno::ECONNREFUSED, "http acceptor should shut down") do
+    assert_raises(*(errs + [ "http acceptor should shut down" ])) do
       100.times do
-        TCPSocket.new(@host, @http)
+        TCPSocket.new(@host, @http).close
         t_yield
       end
     end
-    assert_raises(Errno::ECONNREFUSED, "mgmt acceptor should shut down") do
+    assert_raises(*(errs + [ "mgmt acceptor should shut down" ])) do
       100.times do
-        TCPSocket.new(@host, @mgmt)
+        TCPSocket.new(@host, @mgmt).close
         t_yield
       end
     end
@@ -102,7 +104,6 @@ class TestGracefulQuit < Test::Unit::TestCase
     bytes = 0
     buf = ""
     begin
-      t_yield
       client.readpartial(666666, buf)
       bytes += buf.size
     rescue EOFError