Skip to content

PYTHON-5315 Fix racy test_recover_from_initially_empty_seedlist and t… - #3143

Merged
NoahStapp merged 1 commit into
mongodb:mainfrom
NoahStapp:PYTHON-5315
Oct 27, 2026
Merged

NoahStapp merged 1 commit into
mongodb:mainfrom
NoahStapp:PYTHON-5315

Conversation

@NoahStapp

@NoahStapp NoahStapp commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

…est_recover_from_initially_erroring_seedlist

PYTHON-5315

Changes in this PR

Fixed racy test to use the correct pattern of nesting SrvPollingKnobs to prevent a real DNS poll from sneaking out between patched ones and failing the test.

Test Plan

Existing test changes.

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?

…est_recover_from_initially_erroring_seedlist
@NoahStapp
NoahStapp marked this pull request as ready for review October 26, 2026 20:02
@NoahStapp
NoahStapp requested a review from a team as a code owner October 26, 2026 20:02
@NoahStapp
NoahStapp requested review from sleepyStick and a balanced review from Copilot October 26, 2026 20:02

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.

🟢 Approval recommended

The focused test-only changes preserve recovery assertions and address the timing gap without introducing identified blocking issues.

No open issues 🎉

What changed in this PR

This PR addresses timing races in the SRV polling recovery tests by keeping polling timing overrides active while resolver callbacks change.

Changes:

  • Keep the short TTL and rescan interval patched across both recovery phases.
  • Nest callback-specific patches without changing the recovery assertions.
File Description
test/​test_srv_polling.py Mirrors the nested patch structure in the generated synchronous tests.
test/​asynchronous/​test_srv_polling.py Preserves timing overrides across resolver callback transitions.

Review effort: Balanced

@NoahStapp
NoahStapp merged commit d89e10f into mongodb:main Oct 27, 2026
80 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.

3 participants