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

Test failure: test.test_bulk.TestBulkWriteConcern.test_write_concern_failure_unordered

    • 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?

      Name of Failure:

      test.test_bulk.TestBulkWriteConcern.test_write_concern_failure_unordered

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_test_ssl__platform~rhel8_auth_ssl~auth_ssl_python_version~3.10_coverage~coverage_test_latest_replica_set_patch_b6f72adb2150338d6b37236fa9ff3244a12c1ce3_6696d4c67bc6870007aa27ae_24_07_16_20_15_10?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Intermittent failure that usually goes away with a re-run.

      Stack trace:

       [2024/07/16 13:35:19.169] FAILURE: AssertionError: False is not true ()
       [2024/07/16 13:35:19.169] self = <test.test_bulk.TestBulkWriteConcern testMethod=test_write_concern_failure_unordered>
       [2024/07/16 13:35:19.169]     @client_context.require_replica_set
       [2024/07/16 13:35:19.169]     @client_context.require_secondaries_count(1)
       [2024/07/16 13:35:19.169]     def test_write_concern_failure_unordered(self):
       [2024/07/16 13:35:19.169]         # Ensure we don't raise on wnote.
       [2024/07/16 13:35:19.169]         coll_ww = self.coll.with_options(write_concern=WriteConcern(w=self.w))
       [2024/07/16 13:35:19.169]         result = coll_ww.bulk_write([DeleteOne({"something": "that does no exist"})], ordered=False)
       [2024/07/16 13:35:19.169]         self.assertTrue(result.acknowledged)
       [2024/07/16 13:35:19.169]     
       [2024/07/16 13:35:19.169]         requests = [
       [2024/07/16 13:35:19.169]             InsertOne({"a": 1}),
       [2024/07/16 13:35:19.169]             UpdateOne({"a": 3}, {"$set": {"a": 3, "b": 1}}, upsert=True),
       [2024/07/16 13:35:19.169]             InsertOne({"a": 2}),
       [2024/07/16 13:35:19.169]         ]
       [2024/07/16 13:35:19.169]         # Replication wtimeout is a 'soft' error.
       [2024/07/16 13:35:19.169]         # It shouldn't stop batch processing.
       [2024/07/16 13:35:19.169]         try:
       [2024/07/16 13:35:19.169]             self.cause_wtimeout(requests, ordered=False)
       [2024/07/16 13:35:19.169]         except BulkWriteError as exc:
       [2024/07/16 13:35:19.169]             details = exc.details
       [2024/07/16 13:35:19.169]             self.assertEqual(exc.code, 65)
       [2024/07/16 13:35:19.169]         else:
       [2024/07/16 13:35:19.169]             self.fail("Error not raised")
       [2024/07/16 13:35:19.169]     
       [2024/07/16 13:35:19.169]         self.assertEqual(2, details["nInserted"])
       [2024/07/16 13:35:19.169]         self.assertEqual(1, details["nUpserted"])
       [2024/07/16 13:35:19.169]         self.assertEqual(0, len(details["writeErrors"]))
       [2024/07/16 13:35:19.169]         # When talking to legacy servers there will be a
       [2024/07/16 13:35:19.169]         # write concern error for each operation.
       [2024/07/16 13:35:19.169] >       self.assertTrue(len(details["writeConcernErrors"]) > 1)
       [2024/07/16 13:35:19.169] E       AssertionError: False is not true
       [2024/07/16 13:35:19.169] test/test_bulk.py:1047: AssertionError
      
          
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            noah.stapp@mongodb.com Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: