diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-07-04 09:36:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-04 09:36:16 (GMT) |
commit | 1fef0154d97bd7f01c5bc59954a278bacf1a3f0e (patch) | |
tree | c8f446f5f2f757959217c1c5bf4547525e424216 /Lib | |
parent | 2e5867d93ab2717f55e0b0622a38d917b00c05e3 (diff) | |
download | cpython-1fef0154d97bd7f01c5bc59954a278bacf1a3f0e.zip cpython-1fef0154d97bd7f01c5bc59954a278bacf1a3f0e.tar.gz cpython-1fef0154d97bd7f01c5bc59954a278bacf1a3f0e.tar.bz2 |
bpo-29796: test_weakref: Fix collect_in_thread() on Windows (#2553)
Sleep 1 ms instead of 0.1 ms to workaround a rounding issue on
Windows. On Windows, time.sleep(0.0001) sleeps 0 ms, so
collect_in_thread() calls gc.collect() in a loop and tests using this
thread takes too long. Sleep 1 ms so time.sleep() sleeps 15.6 ms on
Windows.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_weakref.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 36f529b..415d5eb 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -58,7 +58,7 @@ class RefCycle: @contextlib.contextmanager -def collect_in_thread(period=0.0001): +def collect_in_thread(period=0.001): """ Ensure GC collections happen in a different thread, at a high frequency. """ |