Skip to content
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

gh-118413: Fix test_release_task_refs on free-threaded build #118494

Merged
merged 1 commit into from
May 2, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented May 1, 2024

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.
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label May 1, 2024
@colesbury colesbury marked this pull request as ready for review May 2, 2024 14:54
@colesbury colesbury requested a review from gpshead as a code owner May 2, 2024 14:54
@colesbury colesbury requested a review from DinoV May 2, 2024 14:54
@colesbury
Copy link
Contributor Author

I'm reasonably confident about this fix now. I was able to reliably trigger the test failure quickly by running it in a loop with multiple tests runners on the same CPU. I'm now able to run that loop for a long time without failures.

Copy link
Contributor

@DinoV DinoV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@colesbury colesbury merged commit 83c51da into python:main May 2, 2024
37 checks passed
@colesbury colesbury deleted the gh-118413-test_release_task_refs branch May 2, 2024 17:41
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants