https://github.com/python/cpython/commit/98c7ae3f7e6fa47cfeee388fb0992a77d6ba163a commit: 98c7ae3f7e6fa47cfeee388fb0992a77d6ba163a branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: colesbury <[email protected]> date: 2025-03-11T14:14:28Z summary:
[3.13] gh-130957: Use `sleeping_retry` in `test_free_reference` (GH-130958) (#131091) The weak reference may not be immediately dead. (cherry picked from commit 19081158713526a3042c2ad3c6d5a589579b420f) Co-authored-by: Sam Gross <[email protected]> files: M Lib/test/test_concurrent_futures/executor.py diff --git a/Lib/test/test_concurrent_futures/executor.py b/Lib/test/test_concurrent_futures/executor.py index 3049bb74861439..3d1372a6428ec0 100644 --- a/Lib/test/test_concurrent_futures/executor.py +++ b/Lib/test/test_concurrent_futures/executor.py @@ -128,4 +128,7 @@ def test_free_reference(self): 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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
