From 05448f74a80b631410f0c39ea4b333d26acec074 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 30 Apr 2013 02:24:19 +0000 Subject: test_epoll: workaround race condition in test_close 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. --- test/test_epoll.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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? -- cgit v1.2.3-24-ge0c7