about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-06 00:21:00 +0000
committerEric Wong <normalperson@yhbt.net>2013-04-12 22:24:59 +0000
commit0f55aa0caa4846aab8e3a8df85fdea884a317a01 (patch)
treec325c4e6f48e09f1e7a443491fa369ce104f13db
parent446033931a8051656585bacd6277e9823a3e62e8 (diff)
downloadsleepy_penguin-0f55aa0caa4846aab8e3a8df85fdea884a317a01.tar.gz
We need to record the time before the thread is spawned for
correct timing
-rw-r--r--test/test_epoll.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index fd22654..1e9a068 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -26,12 +26,12 @@ class TestEpoll < Test::Unit::TestCase
 
   def test_cross_thread
     tmp = []
-    Thread.new { sleep 0.100; @ep.add(@wr, Epoll::OUT) }
     t0 = Time.now
+    Thread.new { sleep 0.100; @ep.add(@wr, Epoll::OUT) }
     @ep.wait { |flags,obj| tmp << [ flags, obj ] }
     elapsed = Time.now - t0
     assert elapsed >= 0.100
-    assert_equal [[Epoll::OUT, @wr]], tmp
+    assert_equal [[Epoll::OUT, @wr]], tmp, tmp.inspect
   end
 
   def test_fork_safe