Skip to content

Commit 1908115

Browse files
authored
gh-130957: Use sleeping_retry in test_free_reference (#130958)
The weak reference may not be immediately dead.
1 parent 44c55c2 commit 1908115

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
@@ -129,4 +129,7 @@ def test_free_reference(self):
129129
wr = weakref.ref(obj)
130130
del obj
131131
support.gc_collect() # For PyPy or other GCs.
132-
self.assertIsNone(wr())
132+
133+
for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
134+
if wr() is None:
135+
break

0 commit comments

Comments
 (0)