-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
WithThreadsTestPool.test_release_task_refs
: flaky test or possible free-threading bug
#118413
Comments
WithThreadsTestPool.test_release_task_refs
: AssertionError: Items in the first set but not the secondWithThreadsTestPool.test_release_task_refs
: flaky test or possible free-threading bug
I'm able to reproduce this locally on Linux with a few modifications: First, apply https://gist.github.com/colesbury/f8ba31699eb6fcc79a29a2dd4e41e817 to enable the test and run it in a loop. Then run multiple test instances in parallel on a single CPU:
|
The fix is to move the cpython/Lib/test/_test_multiprocessing.py Lines 2816 to 2817 in c408c36
The |
The `time.sleep()` call should happen before the GC to give the worker threads time to clean-up their remaining references to objs. Additionally, use `support.gc_collect()` instead of `gc.collect()` just in case the extra GC calls matter.
The `time.sleep()` call should happen before the GC to give the worker threads time to clean-up their remaining references to objs. Additionally, use `support.gc_collect()` instead of `gc.collect()` just in case the extra GC calls matter.
The test is fixed now and re-enabled in the free-threaded build. |
…ython#118494) The `time.sleep()` call should happen before the GC to give the worker threads time to clean-up their remaining references to objs. Additionally, use `support.gc_collect()` instead of `gc.collect()` just in case the extra GC calls matter.
This might be a free-threading related bug or possibly a flaky test. We should investigate and try to figure out the root cause.
Originally reported by hugovk in #118331 (comment) (https://github.com/python/cpython/actions/runs/8884999534/attempts/1).
Linked PRs
test_release_task_refs
in free-threaded builds #118491The text was updated successfully, but these errors were encountered: