Skip to content

PYTHON-6200 Wait for monitor threads/tasks to finish in test_close_cl… - #3159

Merged
NoahStapp merged 1 commit into
mongodb:mainfrom
NoahStapp:PYTHON-6200
Oct 28, 2026
Merged

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

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

…oses_sockets

PYTHON-6200

Changes in this PR

Wait for monitor threads/tasks to finish before asserting in test_close_closes_sockets.

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 28, 2026 19:02
@NoahStapp
NoahStapp requested review from sleepyStick and a balanced review from Copilot October 28, 2026 19: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

No active review issues were identified for the changes that wait for background monitors before checking socket cleanup.

No open issues 🎉

What changed in this PR

This PR reduces timing-related failures in test_close_closes_sockets by waiting for background monitors to finish before checking cleanup.

Changes:

  • Join the server and round-trip-time monitor executors with 10-second timeouts before assertions.
  • Apply the waits to both asynchronous and generated synchronous tests, with comments marking them as temporary pending PYTHON-1634.
File Description
test/​test_client.py Adds monitor-thread joins before cleanup assertions.
test/​asynchronous/​test_client.py Awaits monitor-task joins before cleanup assertions.

Review effort: Balanced

@NoahStapp
NoahStapp merged commit 808767c into mongodb:main Oct 28, 2026
74 of 75 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