Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion test/asynchronous/test_retryable_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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
Expand Down Expand Up @@ -295,6 +295,9 @@ async def test_03_01_retryable_reads_caused_by_overload_errors_are_retried_on_a_
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",
Expand Down Expand Up @@ -334,6 +337,9 @@ async def test_03_02_retryable_reads_caused_by_non_overload_errors_are_retried_o
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",
Expand Down Expand Up @@ -375,6 +381,9 @@ async def test_03_03_retryable_reads_caused_by_overload_errors_are_retried_on_th
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",
Expand Down
11 changes: 10 additions & 1 deletion test/test_retryable_reads.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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
Expand Down Expand Up @@ -293,6 +293,9 @@ def test_03_01_retryable_reads_caused_by_overload_errors_are_retried_on_a_differ
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",
Expand Down Expand Up @@ -332,6 +335,9 @@ def test_03_02_retryable_reads_caused_by_non_overload_errors_are_retried_on_the_
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",
Expand Down Expand Up @@ -373,6 +379,9 @@ def test_03_03_retryable_reads_caused_by_overload_errors_are_retried_on_the_same
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",
Expand Down
Loading