about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-19 23:52:36 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-20 00:09:04 +0000
commita108236d619c950add6d5a8331450180a506c6ea (patch)
treefcd92465616f0dfcd0475d186b726c1688789a0d
parent347130d795ccc85944964a36d5b5c1d60635eb81 (diff)
downloadyahns-a108236d619c950add6d5a8331450180a506c6ea.tar.gz
This should hopefully increase test reliability as timing of
signal delivery is not guaranteed...
-rw-r--r--test/test_server.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_server.rb b/test/test_server.rb
index 649c826..825afd9 100644
--- a/test/test_server.rb
+++ b/test/test_server.rb
@@ -51,8 +51,11 @@ class TestServer < Testcase
       end
     end
     Process.kill(:QUIT, pid)
-    "GET / HTTP/1.1\r\n\r\n".each_byte { |x| Thread.pass; c.write(x.chr) }
-    buf = Timeout.timeout(10) { c.read }
+    "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n".each_byte do |x|
+      sleep(0.01)
+      c.write(x.chr)
+    end
+    buf = Timeout.timeout(30) { c.read }
     assert_match(/Connection: close/, buf)
     _, status = Timeout.timeout(10) { Process.waitpid2(pid) }
     assert status.success?, status.inspect