PYTHON-5975 Fix missing await calls in async test suite - #3029
Draft
blink1073 wants to merge 1 commit into
Draft
Conversation
ResetPoolThread.run() never awaited its async _run(), so the pool-reset loop never executed during test_reset_during_update_pool; replace it with the existing ConcurrentRunner helper, which runs correctly under both sync and async execution. InsertEventListener.succeeded() never awaited its admin.command() call, so the coroutine was discarded and the failCommand fail point was never configured. succeeded() is invoked synchronously by the shared command monitoring dispatch code, so it can't become async; schedule the command via create_task on the async path instead.
blink1073
force-pushed
the
claude/python-5975-jira-ticket-171e7d
branch
from
September 1, 2026 11:58
068b8dc to
b182c9b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-5975
Changes in this PR
ResetPoolThreadintest_reset_during_update_poolwith the existingConcurrentRunnertest helper, since the rawthreading.Threadcalled its async_run()without awaiting it (and aThread.run()has no event loop to run it in anyway).InsertEventListener.succeeded()so it actually runs theconfigureFailPointadmin command instead of discarding an unawaited coroutine.succeeded()is invoked synchronously by the shared command-monitoring dispatch code and can't becomeasync, so the async path now schedules the command viacreate_task.Test Plan
just synchro,just lint, andmypy --config-file mypy_test.ini testall pass with no new errors.test/test_client.py::TestClient::test_reset_during_update_poolpasses against a local standalone server; confirmed it also passes with therequire_syncskip temporarily removed, proving theConcurrentRunner-based fix genuinely works under async execution.test/test_client.pyandtest/test_retryable_writes.pysuites (sync and async) pass locally; replica-set-gated tests skip against the standalone server available here.InsertEventListener's sync-mode behavior is unchanged from before this PR, so no regression risk there.Checklist
Checklist for Author
Checklist for Reviewer