about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-30 02:24:19 +0000
committerEric Wong <normalperson@yhbt.net>2013-04-30 02:24:19 +0000
commit05448f74a80b631410f0c39ea4b333d26acec074 (patch)
tree00f4b13ac347bc8ba00615d8d24f41ffdeaedcc0
parentc1fdf07413364407d148fb588cd1c2ba1fe7f677 (diff)
downloadsleepy_penguin-05448f74a80b631410f0c39ea4b333d26acec074.tar.gz
Wait longer before killing the epoll_wait thread, as we may not
have entered epoll_wait inside that thread before we send
Thread#kill to it.  This caused intermittent IOError as the
thread delected the Epoll::IO object was already closed, before
the snapshot (to prevent GC) could be made.
-rw-r--r--test/test_epoll.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index bdb550b..4b4437a 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -197,7 +197,8 @@ class TestEpoll < Test::Unit::TestCase
     thr = Thread.new { @ep.wait { |flags, obj| tmp << [ flags, obj ] } }
     @rd.close
     @wr.close
-    assert_nil thr.join(0.01)
+    Thread.pass
+    assert_nil thr.join(0.25)
     assert thr.alive?
     thr.kill
     assert tmp.empty?