diff --git a/pymongo/asynchronous/client_bulk.py b/pymongo/asynchronous/client_bulk.py index bda374e9b..508b8e41c 100644 --- a/pymongo/asynchronous/client_bulk.py +++ b/pymongo/asynchronous/client_bulk.py @@ -569,7 +569,6 @@ class _AsyncClientBulk: and "errorLabels" in error.details and isinstance(error.details["errorLabels"], list) and "RetryableError" in error.details["errorLabels"] - and "SystemOverloadedError" in error.details["errorLabels"] ) # Synthesize the full bulk result without modifying the diff --git a/pymongo/synchronous/client_bulk.py b/pymongo/synchronous/client_bulk.py index 30f32488e..e8167bced 100644 --- a/pymongo/synchronous/client_bulk.py +++ b/pymongo/synchronous/client_bulk.py @@ -567,7 +567,6 @@ class _ClientBulk: and "errorLabels" in error.details and isinstance(error.details["errorLabels"], list) and "RetryableError" in error.details["errorLabels"] - and "SystemOverloadedError" in error.details["errorLabels"] ) # Synthesize the full bulk result without modifying the diff --git a/test/asynchronous/test_client_backpressure.py b/test/asynchronous/test_client_backpressure.py index 9e617d74e..d79a9114d 100644 --- a/test/asynchronous/test_client_backpressure.py +++ b/test/asynchronous/test_client_backpressure.py @@ -96,20 +96,18 @@ class TestBackpressure(AsyncIntegrationTest): @async_client_context.require_failCommand_appName async def test_retry_overload_error_insert_one(self): - await self.db.t.insert_one({"x": 1}) - # Ensure command is retried on overload error. fail_many = mock_overload_error.copy() fail_many["mode"] = {"times": _MAX_RETRIES} async with self.fail_point(fail_many): - await self.db.t.find_one() + await self.db.t.insert_one({"x": 1}) # Ensure command stops retrying after _MAX_RETRIES. fail_too_many = mock_overload_error.copy() fail_too_many["mode"] = {"times": _MAX_RETRIES + 1} async with self.fail_point(fail_too_many): with self.assertRaises(PyMongoError) as error: - await self.db.t.find_one() + await self.db.t.insert_one({"x": 1}) self.assertIn("RetryableError", str(error.exception)) self.assertIn("SystemOverloadedError", str(error.exception)) diff --git a/test/test_client_backpressure.py b/test/test_client_backpressure.py index 0a2e60941..b82846d35 100644 --- a/test/test_client_backpressure.py +++ b/test/test_client_backpressure.py @@ -96,20 +96,18 @@ class TestBackpressure(IntegrationTest): @client_context.require_failCommand_appName def test_retry_overload_error_insert_one(self): - self.db.t.insert_one({"x": 1}) - # Ensure command is retried on overload error. fail_many = mock_overload_error.copy() fail_many["mode"] = {"times": _MAX_RETRIES} with self.fail_point(fail_many): - self.db.t.find_one() + self.db.t.insert_one({"x": 1}) # Ensure command stops retrying after _MAX_RETRIES. fail_too_many = mock_overload_error.copy() fail_too_many["mode"] = {"times": _MAX_RETRIES + 1} with self.fail_point(fail_too_many): with self.assertRaises(PyMongoError) as error: - self.db.t.find_one() + self.db.t.insert_one({"x": 1}) self.assertIn("RetryableError", str(error.exception)) self.assertIn("SystemOverloadedError", str(error.exception))