From: Sam Gross Date: Tue, 11 Mar 2025 13:51:26 +0000 (-0400) Subject: gh-130957: Use `sleeping_retry` in `test_free_reference` (#130958) X-Git-Tag: v3.14.0a6~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19081158713526a3042c2ad3c6d5a589579b420f;p=thirdparty%2FPython%2Fcpython.git gh-130957: Use `sleeping_retry` in `test_free_reference` (#130958) The weak reference may not be immediately dead. --- diff --git a/Lib/test/test_concurrent_futures/executor.py b/Lib/test/test_concurrent_futures/executor.py index b97d9ffd94b1..dc92d2d7e4af 100644 --- a/Lib/test/test_concurrent_futures/executor.py +++ b/Lib/test/test_concurrent_futures/executor.py @@ -129,4 +129,7 @@ class ExecutorTest: wr = weakref.ref(obj) del obj support.gc_collect() # For PyPy or other GCs. - self.assertIsNone(wr()) + + for _ in support.sleeping_retry(support.SHORT_TIMEOUT): + if wr() is None: + break