about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-02-08 03:18:26 -0500
committerEric Wong <e@80x24.org>2014-02-08 08:35:41 +0000
commite86802a1f3f7ac34d32483f9d5de7e627e984db7 (patch)
tree0d4e11293c370955fd8369fe35661c1c708f3625 /test
parentdda19354de0bc72c1ab7ea49537a0ae2b019e837 (diff)
downloadyahns-e86802a1f3f7ac34d32483f9d5de7e627e984db7.tar.gz
Not all TCP stacks behave the same with timing-sensitive tests.
Fortunately these timing differences aren't very critical over real
networks.
Diffstat (limited to 'test')
-rw-r--r--test/test_client_expire.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_client_expire.rb b/test/test_client_expire.rb
index bdf0cb4..4f20803 100644
--- a/test/test_client_expire.rb
+++ b/test/test_client_expire.rb
@@ -149,9 +149,17 @@ class TestClientExpire < Testcase
         Process.waitpid2(_pid)
       end
     end
+
+    # this seems to be needed in Debian GNU/kFreeBSD
+    linux = !!(RUBY_PLATFORM =~ /linux/)
+    sleep(1) unless linux
+
     [ f, s ].each do |io|
       assert_raises(Errno::EPIPE,Errno::ECONNRESET) do
-        req.each_byte { |b| io.write(b.chr) }
+        req.each_byte do |b|
+          io.write(b.chr)
+          sleep(0.01) unless linux
+        end
       end
       io.close
     end