Skip to content

Commit afffd97

Browse files
[3.12] gh-130957: Use sleeping_retry in test_free_reference (GH-130958) (#131092)
The weak reference may not be immediately dead. (cherry picked from commit 1908115) Co-authored-by: Sam Gross <[email protected]>
1 parent 729ec5b commit afffd97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_concurrent_futures/executor.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,7 @@ def test_free_reference(self):
105105
wr = weakref.ref(obj)
106106
del obj
107107
support.gc_collect() # For PyPy or other GCs.
108-
self.assertIsNone(wr())
108+
109+
for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
110+
if wr() is None:
111+
break

0 commit comments

Comments
 (0)