Skip to content

PYTHON-5366 - test_pool_reset waits until Pool.reset() increments gen… - #2797

Merged
NoahStapp merged 3 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5366
May 18, 2026
Merged

NoahStapp merged 3 commits into
mongodb:masterfrom
NoahStapp:PYTHON-5366

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

…eration

PYTHON-5366

Changes in this PR

Make test.test_topology.TestTopologyErrors.test_pool_reset explicitly wait for the failed hello to trigger Pool.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 there test coverage?
  • [ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@NoahStapp
NoahStapp requested a review from a team as a code owner May 7, 2026 18:54
@NoahStapp
NoahStapp requested review from aclark4life, caseyclements and Copilot and removed request for caseyclements May 7, 2026 18:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 @flaky decorator from test_pool_reset by fixing the underlying synchronization race.
  • Replaces a timing-sensitive assertNotEqual with a wait_until that polls until the pool generation changes.

@codecov-commenter

codecov-commenter commented May 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codeowners-service-app

Copy link
Copy Markdown

Assigned caseyclements for team dbx-python because aclark4life is out of office.

@NoahStapp
NoahStapp merged commit 9a8e34c into mongodb:master May 18, 2026
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants