test: relax test timings for timed* tests
authorew@fbsd90-32.(none) <ew@fbsd90-32.(none)>
Wed, 11 Jul 2012 02:54:33 +0000 (11 02:54 +0000)
committerEric Wong <normalperson@yhbt.net>
Thu, 12 Jul 2012 19:30:56 +0000 (12 12:30 -0700)
On my i386-freebsd9 VM, this takes just longer than the
maximum allowable time.

test/test_posix_mq.rb

index 82ab868..1cc24aa 100644 (file)
@@ -73,8 +73,8 @@ class Test_POSIX_MQ < Test::Unit::TestCase
     t0 = Time.now
     maybe_timeout { @mq.receive "", interval } or return
     elapsed = Time.now - t0
-    assert elapsed > interval, elapsed.inspect
-    assert elapsed < 0.02, elapsed.inspect
+    assert_operator elapsed, :>, interval, elapsed.inspect
+    assert_operator elapsed, :<, 0.04, elapsed.inspect
   end
 
   def test_timed_receive_divmod
@@ -87,8 +87,8 @@ class Test_POSIX_MQ < Test::Unit::TestCase
     t0 = Time.now
     maybe_timeout { @mq.receive "", interval } or return
     elapsed = Time.now - t0
-    assert elapsed >= 0.01, elapsed.inspect
-    assert elapsed <= 0.02, elapsed.inspect
+    assert_operator elapsed, :>=, 0.01, elapsed.inspect
+    assert_operator elapsed, :<=, 0.04, elapsed.inspect
   end
 
   def test_timed_receive_fixnum