Skip to content

Commit 98c7ae3

Browse files
miss-islingtoncolesbury
andauthoredMar 11, 2025
[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 1908115) Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent a49f85a commit 98c7ae3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

Diff for: ‎Lib/test/test_concurrent_futures/executor.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,7 @@ def test_free_reference(self):
128128
wr = weakref.ref(obj)
129129
del obj
130130
support.gc_collect() # For PyPy or other GCs.
131-
self.assertIsNone(wr())
131+
132+
for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
133+
if wr() is None:
134+
break

0 commit comments

Comments
 (0)