Bug 979299 - Reduce fragility in real time test. r=dburns, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 17 Mar 2014 17:40:16 -0400
changeset 192175 3f4a4fc2578be76eb03a8de8ee3b102f67eefb81
parent 192174 9c3066b480701cfc63b212fdbc5c5332b5511c8d
child 192176 b70ad49d688284c5304ceb50aae8f429b68652a5
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns, test-only
bugs979299
milestone30.0a2
Bug 979299 - Reduce fragility in real time test. r=dburns, a=test-only Sometimes the clock.sleep(0.1) may take shorter than 0.1 seconds. This isn't a test about precision in Python, but rather that the SystemClock wrapper works as intended and returns a somewhat expected value.
testing/marionette/client/marionette/tests/unit/test_wait.py
--- a/testing/marionette/client/marionette/tests/unit/test_wait.py
+++ b/testing/marionette/client/marionette/tests/unit/test_wait.py
@@ -85,18 +85,17 @@ class SystemClockTest(MarionetteTestCase
 
     def test_construction_initializes_time(self):
         self.assertEqual(self.clock._time, time)
 
     def test_sleep(self):
         start = time.time()
         self.clock.sleep(0.1)
         end = time.time() - start
-
-        self.assertGreaterEqual(end, 0.1)
+        self.assertGreater(end, 0)
 
     def test_time_now(self):
         self.assertIsNotNone(self.clock.now)
 
 class FormalWaitTest(MarionetteTestCase):
     def setUp(self):
         super(FormalWaitTest, self).setUp()
         self.m = MockMarionette()