Skip to content

PYTHON-5925 Fix flaky SRV polling monitor tests#2924

Merged
blink1073 merged 2 commits into
mongodb:masterfrom
blink1073:PYTHON-5925
Jul 10, 2026
Merged

PYTHON-5925 Fix flaky SRV polling monitor tests#2924
blink1073 merged 2 commits into
mongodb:masterfrom
blink1073:PYTHON-5925

Conversation

@blink1073

@blink1073 blink1073 commented Jul 9, 2026

Copy link
Copy Markdown
Member

PYTHON-5925

Changes in this PR

Fixes the flakiness in test_dns_failures_logging. Also removes the now-unnecessary @flaky markers for PYTHON-5315 on the SRV seedlist recovery tests, since the underlying test-harness race conditions are resolved.

Test Plan

Verified locally (repeated runs) and Evergreen patch builds, including a full-matrix confirmation run targeting the previously-failing variants (win32/win64/pyopenssl-win64/etc.). The remaining failures there are pre-existing and unrelated to this change.

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?

blink1073 added 2 commits July 9, 2026 16:33
Fixes the flakiness in test_dns_failures_logging and removes the
now-unnecessary PYTHON-5315 flaky markers on the SRV seedlist
recovery tests.
Documents the FunctionCallRecorder sync/async recording-timing
difference, and drops a redundant re-check that duplicated the
preceding wait_until's condition.
@blink1073
blink1073 marked this pull request as ready for review July 9, 2026 22:35
@blink1073
blink1073 requested a review from a team as a code owner July 9, 2026 22:35
@blink1073
blink1073 requested review from NoahStapp and Copilot July 9, 2026 22:35

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

Reduces flakiness in SRV polling monitor tests by making log assertions resilient to timing, and by improving a shared test utility so recorded async calls represent coroutines that actually completed.

Changes:

  • Update FunctionCallRecorder to record coroutine invocations only after the coroutine finishes (success/exception/cancellation), and add descriptor support for method-style binding.
  • Fix test_dns_failures_logging (sync/async) by waiting until the expected “SRV monitor check failed” log record appears instead of asserting immediately.
  • Remove now-unnecessary @flaky markers from SRV seedlist recovery tests (sync/async).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/utils_shared.py Refines FunctionCallRecorder semantics for async functions and adds __get__ for method binding.
test/test_srv_polling.py Replaces immediate log-count assertion with wait_until; removes @flaky usage.
test/asynchronous/test_srv_polling.py Async equivalent: uses async_wait_until; removes @flaky usage.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073
blink1073 merged commit a706c06 into mongodb:master Jul 10, 2026
88 checks passed
@blink1073
blink1073 deleted the PYTHON-5925 branch July 10, 2026 13:45
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