From: Raymond Hettinger Date: Fri, 21 Feb 2003 01:41:36 +0000 (+0000) Subject: SF bug #690083: test_random fails sometimes X-Git-Tag: v2.3c1~1743 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=785d0a37e510ab4c76dc82e4605ad9ea0231d0a1;p=python SF bug #690083: test_random fails sometimes 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. --- diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 9a1636a283..50bf00b72c 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -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)