PYTHON-5366 - test_pool_reset waits until Pool.reset() increments gen…#2797
Open
NoahStapp wants to merge 3 commits intomongodb:masterfrom
Open
PYTHON-5366 - test_pool_reset waits until Pool.reset() increments gen…#2797NoahStapp wants to merge 3 commits intomongodb:masterfrom
NoahStapp wants to merge 3 commits intomongodb:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a race in TestTopologyErrors.test_pool_reset by making the test explicitly wait for the monitor thread’s failed hello to trigger Pool.reset() and increment the pool generation, instead of relying on immediate post-trigger state.
Changes:
- Removes the
@flakydecorator fromtest_pool_resetby fixing the underlying synchronization race. - Replaces a timing-sensitive
assertNotEqualwith await_untilthat polls until the pool generation changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…eration
PYTHON-5366
Changes in this PR
Make
test.test_topology.TestTopologyErrors.test_pool_resetexplicitly wait for the failed hello to triggerPool.reset()and bump the generation instead of the current synchronization race.Test Plan
Test fixing.
Checklist
Checklist for Author
[ ] Did you update the changelog (if necessary)?[ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).Checklist for Reviewer