Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4650

Test Failure - test_no_batch_splits_if_new_namespace_is_not_too_large

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_compression__platform~rhel8_compression~zlib_python_version~3.11_c_extensions~with_c_extensions_test_latest_standalone_13cf110f016b36926ce836552c7b324b0ea7dba0_24_08_07_23_17_48

            Assignee:
            shruti.sridhar@mongodb.com Shruti Sridhar (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: