https://github.com/python/cpython/commit/19081158713526a3042c2ad3c6d5a589579b420f
commit: 19081158713526a3042c2ad3c6d5a589579b420f
branch: main
author: Sam Gross <colesb...@gmail.com>
committer: colesbury <colesb...@gmail.com>
date: 2025-03-11T09:51:26-04:00
summary:

gh-130957: Use `sleeping_retry` in `test_free_reference` (#130958)

The weak reference may not be immediately dead.

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 b97d9ffd94b1f8..dc92d2d7e4af92 100644
--- a/Lib/test/test_concurrent_futures/executor.py
+++ b/Lib/test/test_concurrent_futures/executor.py
@@ -129,4 +129,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 -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to