]> granicus.if.org Git - python/commitdiff
SF bug #690083: test_random fails sometimes
authorRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 01:41:36 +0000 (01:41 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 01:41:36 +0000 (01:41 +0000)
time.sleep(1) sometimes delays for fractionally less than a second
resulting in too short of an interval for C's time.time() function
to create a distinct seed.

Lib/test/test_random.py

index 9a1636a2836ee4cdf79f0d55adce7d8746f7b5ff..50bf00b72cdc745a400aa0fe3f93672fcaa21746 100644 (file)
@@ -19,7 +19,7 @@ class TestBasicOps(unittest.TestCase):
     def test_autoseed(self):
         self.gen.seed()
         state1 = self.gen.getstate()
-        time.sleep(1)
+        time.sleep(1.1)
         self.gen.seed()      # diffent seeds at different times
         state2 = self.gen.getstate()
         self.assertNotEqual(state1, state2)