Skip to content

PYTHON-6193 Add ServerDescription filter to test.test_client.TestClie… - #3147

Merged
NoahStapp merged 2 commits into
mongodb:mainfrom
NoahStapp:PYTHON-6193
Oct 27, 2026
Merged

NoahStapp merged 2 commits into
mongodb:mainfrom
NoahStapp:PYTHON-6193

Conversation

@NoahStapp

@NoahStapp NoahStapp commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

…nt.test_continuous_network_errors

PYTHON-6193

Changes in this PR

Add a filter to test_continuous_network_errors to only count ServerDescriptions created by the test's client. Shrink the allowed delta to catch regressions more accurately.

Test Plan

Existing test 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?

@NoahStapp
NoahStapp requested a review from a team as a code owner October 26, 2026 20:51
@NoahStapp
NoahStapp requested review from aclark4life and a balanced review from Copilot October 26, 2026 20:51

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 changes match the intended endpoint and strengthen the existing regression check without identified blocking issues.

No open issues 🎉

What changed in this PR

This test-only change makes the network-error memory-leak regression check more precise by excluding ServerDescription objects for unrelated endpoints.

Changes:

  • Count only descriptions matching the test endpoint, ("invalid", 27017).
  • Tighten the allowed count delta from 30 to 10 and update the illustrative assertion comment.
File Description
test/​test_client.py Mirrors the endpoint filter and tighter threshold in the generated synchronous test.
test/​asynchronous/​test_client.py Adds endpoint filtering and tightens the asynchronous regression check.

Review effort: Balanced

@NoahStapp
NoahStapp merged commit 49ba047 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