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

fix flaky tests on free-threaded build #4576

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

ngoldbaum
Copy link
Contributor

These asserts should all be skipped for the same reason as the assert that's skipped already.

Also moved the explanation to the docstring for the struct we use for this.

@ngoldbaum ngoldbaum added CI-build-full CI-skip-changelog Skip checking changelog entry labels Sep 24, 2024
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks! Think a couple of these might be overzealous, though the rest look fine. I guess the point is that the GC runs in a separate thread, so tp_clear calls are done in the background?

tests/test_gc.rs Outdated
Comment on lines 84 to 87
#[cfg(not(Py_GIL_DISABLED))]
assert!(drop_called1.load(Ordering::Relaxed));
#[cfg(not(Py_GIL_DISABLED))]
assert!(drop_called2.load(Ordering::Relaxed));
Copy link
Member

Choose a reason for hiding this comment

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

This test doesn't rely on a __clear__ function, so I think shouldn't be flaky with gc. Was this change out of an abundance of caution or because you did observe flakiness?

tests/test_gc.rs Outdated
Comment on lines 241 to 244
#[cfg(not(Py_GIL_DISABLED))]
assert!(drop_called1.load(Ordering::Relaxed));
#[cfg(not(Py_GIL_DISABLED))]
assert!(drop_called2.load(Ordering::Relaxed));
Copy link
Member

Choose a reason for hiding this comment

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

Similarly no __clear__ / gc integration here.

@ngoldbaum
Copy link
Contributor Author

Thanks for pointing that out, that was me misunderstanding rather than being overzealous.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Understood, this LGTM now 👍

@davidhewitt davidhewitt added this pull request to the merge queue Sep 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 26, 2024
@davidhewitt davidhewitt added this pull request to the merge queue Sep 26, 2024
Merged via the queue into PyO3:main with commit 1ae08de Sep 26, 2024
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-build-full CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants