Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More leniant time contraints for random dynamic timers

  • Loading branch information...
commit c7250c0094c21ab7e97a57b8309f28b502ef8f93 1 parent 59f5106
Philippe Hanrigou authored November 01, 2008

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  test/system_timer_functional_test.rb
6  test/system_timer_functional_test.rb
@@ -225,9 +225,9 @@
225 225
     10.times do
226 226
       a_timeout = [1, (rand(10)).to_i].max
227 227
       all_threads << Thread.new do
228  
-        assert_timeout_within(a_timeout, 4) do
  228
+        assert_timeout_within(a_timeout, 10) do
229 229
           SystemTimer.timeout(a_timeout) do
230  
-             sleep 60
  230
+             sleep 180
231 231
           end
232 232
         end
233 233
       end
@@ -246,7 +246,7 @@ def assert_timeout_within(expected_timeout_in_seconds,
246 246
     elapsed = Time.now - start
247 247
     assert elapsed >= expected_timeout_in_seconds, 
248 248
            "Timed out too early, expected #{expected_timeout_in_seconds}, got #{elapsed} s"
249  
-    assert elapsed < error_margin * expected_timeout_in_seconds, 
  249
+    assert elapsed < (expected_timeout_in_seconds + error_margin), 
250 250
            "Timed out after #{elapsed} seconds, expected #{expected_timeout_in_seconds}"
251 251
   end
252 252
   

0 notes on commit c7250c0

Please sign in to comment.
Something went wrong with that request. Please try again.