PYTHON-5798 - Overload retargeting prose tests do not ensure that sec… (#2760)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Noah Stapp 2026-04-16 13:32:50 -04:00 committed by GitHub
parent b4e2c03a92
commit 912ef337f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View File

@ -19,7 +19,7 @@ import os
import pprint
import sys
import threading
from test.asynchronous.utils import async_set_fail_point
from test.asynchronous.utils import async_ensure_all_connected, async_set_fail_point
from unittest import mock
from pymongo import MongoClient
@ -295,6 +295,9 @@ class TestRetryableReads(AsyncIntegrationTest):
enableOverloadRetargeting=True,
)
# Ensure the client has discovered all nodes.
await async_ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError and SystemOverloadedError error labels.
command_args = {
"configureFailPoint": "failCommand",
@ -334,6 +337,9 @@ class TestRetryableReads(AsyncIntegrationTest):
event_listeners=[listener], retryReads=True, readPreference="primaryPreferred"
)
# Ensure the client has discovered all nodes.
await async_ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError error label.
command_args = {
"configureFailPoint": "failCommand",
@ -375,6 +381,9 @@ class TestRetryableReads(AsyncIntegrationTest):
readPreference="primaryPreferred",
)
# Ensure the client has discovered all nodes.
await async_ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError and SystemOverloadedError error labels.
command_args = {
"configureFailPoint": "failCommand",

View File

@ -19,7 +19,7 @@ import os
import pprint
import sys
import threading
from test.utils import set_fail_point
from test.utils import ensure_all_connected, set_fail_point
from unittest import mock
from pymongo import MongoClient
@ -293,6 +293,9 @@ class TestRetryableReads(IntegrationTest):
enableOverloadRetargeting=True,
)
# Ensure the client has discovered all nodes.
ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError and SystemOverloadedError error labels.
command_args = {
"configureFailPoint": "failCommand",
@ -332,6 +335,9 @@ class TestRetryableReads(IntegrationTest):
event_listeners=[listener], retryReads=True, readPreference="primaryPreferred"
)
# Ensure the client has discovered all nodes.
ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError error label.
command_args = {
"configureFailPoint": "failCommand",
@ -373,6 +379,9 @@ class TestRetryableReads(IntegrationTest):
readPreference="primaryPreferred",
)
# Ensure the client has discovered all nodes.
ensure_all_connected(client)
# 2. Configure a fail point with the RetryableError and SystemOverloadedError error labels.
command_args = {
"configureFailPoint": "failCommand",