-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-129441: Fix some flakiness in test_instrumentation #141881
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-129441: Fix some flakiness in test_instrumentation #141881
Conversation
Most of the `self.assertTrue(self.called)` checks are flaky because the worker threads may sometimes finish before the main thread calls `self.during_threads()`.
|
🤖 New build scheduled with the buildbot fleet by @colesbury for commit dffc16c 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F141881%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Replacing time.sleep(0.1) with Barrier is a nice fix: sleep() is not a reliable synchronization method. With Barrier, self.called becomes redundant and so can be removed.
Unrelated failure:
|
|
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
GH-141913 is a backport of this pull request to the 3.14 branch. |
|
GH-141914 is a backport of this pull request to the 3.13 branch. |
Most of the
self.assertTrue(self.called)checks are flaky because the worker threads may sometimes finish before the main thread callsself.during_threads().