-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
test_concurrent_futures
: test_free_reference
is flaky
#130957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can more easily reproduce this failure by adding a diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py
index 909359b6487..73cce87b5dd 100644
--- a/Lib/concurrent/futures/thread.py
+++ b/Lib/concurrent/futures/thread.py
@@ -90,6 +90,7 @@ def run(self, ctx):
self = None
else:
self.future.set_result(result)
+ time.sleep(1)
__class_getitem__ = classmethod(types.GenericAlias) |
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Mar 7, 2025
The weak reference may not be immediately dead.
colesbury
added a commit
that referenced
this issue
Mar 11, 2025
The weak reference may not be immediately dead.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 11, 2025
…nGH-130958) The weak reference may not be immediately dead. (cherry picked from commit 1908115) Co-authored-by: Sam Gross <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 11, 2025
…nGH-130958) The weak reference may not be immediately dead. (cherry picked from commit 1908115) Co-authored-by: Sam Gross <[email protected]>
This was referenced Mar 11, 2025
colesbury
added a commit
that referenced
this issue
Mar 11, 2025
…30958) (#131092) The weak reference may not be immediately dead. (cherry picked from commit 1908115) Co-authored-by: Sam Gross <[email protected]>
colesbury
added a commit
that referenced
this issue
Mar 11, 2025
…30958) (#131091) The weak reference may not be immediately dead. (cherry picked from commit 1908115) Co-authored-by: Sam Gross <[email protected]>
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
…n#130958) The weak reference may not be immediately dead.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Seen in https://buildbot.python.org/#/builders/1368/builds/2775/steps/6/logs/stdio
The test attempts to ensure that the executor doesn't hold on to the result object, but the executor necessarily holds onto it for a brief period from when it sets the result in in the future until the variable goes out of scope.
We should use
support.sleeping_retry
to check if the weakref eventually (ideally quickly) becomes dead.cpython/Lib/test/test_concurrent_futures/executor.py
Lines 125 to 132 in 12db452
cpython/Lib/concurrent/futures/thread.py
Lines 85 to 92 in 12db452
Linked PRs
sleeping_retry
intest_free_reference
#130958sleeping_retry
intest_free_reference
(GH-130958) #131091sleeping_retry
intest_free_reference
(GH-130958) #131092The text was updated successfully, but these errors were encountered: