Bug 979299 - Reduce fragility in real time test. r=dburns
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 17 Mar 2014 17:40:16 -0400
changeset 173966 c3431749b0acaf5f9c5154651cf8c185017a698e
parent 173965 8eac82c5e61691e6f7b2b4ee2b2728d4a235dc3c
child 173967 a01f97c1ed02e49e8d4289d8e9b5544f67c856bb
push id26438
push userphilringnalda@gmail.com
push dateTue, 18 Mar 2014 05:39:07 +0000
treeherderautoland@89275f0ae29f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdburns
bugs979299
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 979299 - Reduce fragility in real time test. r=dburns 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()