mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
c355f0cae9
commit
785d0a37e5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue