[pypy-svn] r71043 - pypy/trunk/pypy/rpython/module/test

arigo at codespeak.net arigo at codespeak.net
Mon Feb 1 20:22:13 CET 2010


Author: arigo
Date: Mon Feb  1 20:22:13 2010
New Revision: 71043

Modified:
   pypy/trunk/pypy/rpython/module/test/test_ll_time.py
Log:
Fix for this test on Mac OS/X.


Modified: pypy/trunk/pypy/rpython/module/test/test_ll_time.py
==============================================================================
--- pypy/trunk/pypy/rpython/module/test/test_ll_time.py	(original)
+++ pypy/trunk/pypy/rpython/module/test/test_ll_time.py	Mon Feb  1 20:22:13 2010
@@ -19,14 +19,22 @@
         def f():
             return time.clock()
         t0 = time.clock()
+        time.sleep(0.011)
         t1 = self.interpret(f, [])
+        time.sleep(0.011)
         t2 = time.clock()
+        time.sleep(0.011)
         t3 = self.interpret(f, [])
+        time.sleep(0.011)
         t4 = time.clock()
+        time.sleep(0.011)
         t5 = self.interpret(f, [])
+        time.sleep(0.011)
         t6 = time.clock()
         # time.clock() and t1() might have a different notion of zero, so
         # we can only subtract two numbers returned by the same function.
+        # Moreover they might have different precisions, but it should
+        # be at least 0.01 seconds, hence the sleeps.
         assert 0 <= t2-t0
         assert 0 <= t3-t1 <= t4-t0
         assert 0 <= t4-t2 <= t5-t1 <= t6-t0



More information about the Pypy-commit mailing list