Context
test.test_client_bulk_write.TestClientBulkWriteCSOT.test_timeout_in_multi_batch_bulk_write
Definition of done
In PYTHON-4692 we applied a skip, but we should address this error:
[2024/08/22 08:03:32.279] FAILURE: AssertionError: TimeoutError() is not an instance of <class 'pymongo.errors.NetworkTimeout'> () [2024/08/22 08:03:32.279] self = <test.asynchronous.test_client_bulk_write.TestClientBulkWriteCSOT testMethod=test_timeout_in_multi_batch_bulk_write> [2024/08/22 08:03:32.279] @async_client_context.require_version_min(8, 0, 0, -24) [2024/08/22 08:03:32.279] @async_client_context.require_failCommand_fail_point [2024/08/22 08:03:32.279] async def test_timeout_in_multi_batch_bulk_write(self): [2024/08/22 08:03:32.279] _OVERHEAD = 500 [2024/08/22 08:03:32.279] [2024/08/22 08:03:32.279] internal_client = await async_rs_or_single_client(timeoutMS=None) [2024/08/22 08:03:32.279] self.addAsyncCleanup(internal_client.close) [2024/08/22 08:03:32.279] [2024/08/22 08:03:32.279] collection = internal_client.db["coll"] [2024/08/22 08:03:32.279] self.addAsyncCleanup(collection.drop) [2024/08/22 08:03:32.279] await collection.drop() [2024/08/22 08:03:32.279] [2024/08/22 08:03:32.279] fail_command = { [2024/08/22 08:03:32.279] "configureFailPoint": "failCommand", [2024/08/22 08:03:32.279] "mode": {"times": 2}, [2024/08/22 08:03:32.279] "data": {"failCommands": ["bulkWrite"], "blockConnection": True, "blockTimeMS": 1010}, [2024/08/22 08:03:32.279] } [2024/08/22 08:03:32.279] async with self.fail_point(fail_command): [2024/08/22 08:03:32.279] models = [] [2024/08/22 08:03:32.279] num_models = int(self.max_message_size_bytes / self.max_bson_object_size + 1) [2024/08/22 08:03:32.279] b_repeated = "b" * (self.max_bson_object_size - _OVERHEAD) [2024/08/22 08:03:32.279] for _ in range(num_models): [2024/08/22 08:03:32.279] models.append( [2024/08/22 08:03:32.279] InsertOne( [2024/08/22 08:03:32.279] namespace="db.coll", [2024/08/22 08:03:32.279] document={"a": b_repeated}, [2024/08/22 08:03:32.279] ) [2024/08/22 08:03:32.279] ) [2024/08/22 08:03:32.279] [2024/08/22 08:03:32.279] listener = OvertCommandListener() [2024/08/22 08:03:32.279] client = await async_rs_or_single_client( [2024/08/22 08:03:32.279] event_listeners=[listener], [2024/08/22 08:03:32.279] readConcernLevel="majority", [2024/08/22 08:03:32.279] readPreference="primary", [2024/08/22 08:03:32.279] timeoutMS=2000, [2024/08/22 08:03:32.279] w="majority", [2024/08/22 08:03:32.279] ) [2024/08/22 08:03:32.279] self.addAsyncCleanup(client.close) [2024/08/22 08:03:32.279] await client.admin.command("ping") # Init the client first. [2024/08/22 08:03:32.279] with self.assertRaises(ClientBulkWriteException) as context: [2024/08/22 08:03:32.279] await client.bulk_write(models=models) [2024/08/22 08:03:32.279] > self.assertIsInstance(context.exception.error, NetworkTimeout) [2024/08/22 08:03:32.279] E AssertionError: TimeoutError() is not an instance of <class 'pymongo.errors.NetworkTimeout'> [2024/08/22 08:03:32.279] test\asynchronous\test_client_bulk_write.py:599: AssertionError
PyMongo shouldn't be raising a TimeOutError. I can reproduce the error on a Windows EVG host with AUTH=auth TOPOLOGY=sharded_cluster MONGODB_VERSION=8.0.
Pitfalls
None
- clones
-
PYTHON-4692 Skip clientBulkWrite CSOT tests on MacOS and Windows
- Closed