test_no_batch_splits_if_new_namespace_is_not_too_large fails when compression is enabled:
[2024/08/08 07:21:15.996] _ TestClientBulkWriteCRUD.test_no_batch_splits_if_new_namespace_is_not_too_large _ [2024/08/08 07:21:15.996] self = <test.asynchronous.test_client_bulk_write.TestClientBulkWriteCRUD testMethod=test_no_batch_splits_if_new_namespace_is_not_too_large> [2024/08/08 07:21:15.996] @async_client_context.require_version_min(8, 0, 0, -24) [2024/08/08 07:21:15.996] async def test_no_batch_splits_if_new_namespace_is_not_too_large(self): [2024/08/08 07:21:15.996] listener = OvertCommandListener() [2024/08/08 07:21:15.996] client = await async_rs_or_single_client(event_listeners=[listener]) [2024/08/08 07:21:15.996] self.addAsyncCleanup(client.aclose) [2024/08/08 07:21:15.996] num_models, models = await self._setup_namespace_test_models() [2024/08/08 07:21:15.996] models.append( [2024/08/08 07:21:15.996] InsertOne( [2024/08/08 07:21:15.996] namespace="db.coll", [2024/08/08 07:21:15.996] document={"a": "b"}, [2024/08/08 07:21:15.996] ) [2024/08/08 07:21:15.996] ) [2024/08/08 07:21:15.996] self.addAsyncCleanup(client.db["coll"].drop) [2024/08/08 07:21:15.996] # No batch splitting required. [2024/08/08 07:21:15.996] result = await client.bulk_write(models=models) [2024/08/08 07:21:15.996] self.assertEqual(result.inserted_count, num_models + 1) [2024/08/08 07:21:15.996] bulk_write_events = [] [2024/08/08 07:21:15.996] for event in listener.started_events: [2024/08/08 07:21:15.996] if event.command_name == "bulkWrite": [2024/08/08 07:21:15.996] bulk_write_events.append(event) [2024/08/08 07:21:15.996] > self.assertEqual(len(bulk_write_events), 1) [2024/08/08 07:21:15.996] E AssertionError: 2 != 1 [2024/08/08 07:21:15.996] test/asynchronous/test_client_bulk_write.py:438: AssertionError [2024/08/08 07:21:15.996] ------------------------------ Captured log call ------------------------------- [2024/08/08 07:21:15.996] WARNING asyncio:base_events.py:1931 Executing <Task finished name='Task-1704' coro=<TestClientBulkWriteCRUD.test_no_batch_splits_if_new_namespace_is_not_too_large() done, defined at /data/mci/a16d9d06dfbfb370f477be355d017e41/src/test/asynchronous/__init__.py:461> exception=AssertionError('2 != 1') created at /opt/python/3.11/lib/python3.11/asyncio/runners.py:100> took 0.314 seconds [2024/08/08 07:21:15.996] _ TestClientBulkWriteCRUD.test_no_batch_splits_if_new_namespace_is_not_too_large _ [2024/08/08 07:21:15.996] self = <test.test_client_bulk_write.TestClientBulkWriteCRUD testMethod=test_no_batch_splits_if_new_namespace_is_not_too_large> [2024/08/08 07:21:15.996] @client_context.require_version_min(8, 0, 0, -24) [2024/08/08 07:21:15.996] def test_no_batch_splits_if_new_namespace_is_not_too_large(self): [2024/08/08 07:21:15.996] listener = OvertCommandListener() [2024/08/08 07:21:15.996] client = rs_or_single_client(event_listeners=[listener]) [2024/08/08 07:21:15.996] self.addCleanup(client.close) [2024/08/08 07:21:15.996] num_models, models = self._setup_namespace_test_models() [2024/08/08 07:21:15.996] models.append( [2024/08/08 07:21:15.996] InsertOne( [2024/08/08 07:21:15.996] namespace="db.coll", [2024/08/08 07:21:15.996] document={"a": "b"}, [2024/08/08 07:21:15.996] ) [2024/08/08 07:21:15.996] ) [2024/08/08 07:21:15.996] self.addCleanup(client.db["coll"].drop) [2024/08/08 07:21:15.996] # No batch splitting required. [2024/08/08 07:21:15.996] result = client.bulk_write(models=models) [2024/08/08 07:21:15.996] self.assertEqual(result.inserted_count, num_models + 1) [2024/08/08 07:21:15.996] bulk_write_events = [] [2024/08/08 07:21:15.996] for event in listener.started_events: [2024/08/08 07:21:15.996] if event.command_name == "bulkWrite": [2024/08/08 07:21:15.996] bulk_write_events.append(event) [2024/08/08 07:21:15.996] > self.assertEqual(len(bulk_write_events), 1) [2024/08/08 07:21:15.996] E AssertionError: 2 != 1 [2024/08/08 07:21:15.996] test/test_client_bulk_write.py:438: AssertionError
- related to
-
PYTHON-4550 Add MongoClient.bulk_write API
- Closed