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

[BuildFailure] TestBulkWriteConcern failures

    • Type: Icon: Build Failure Build Failure
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Python Drivers
    • 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_ordered
      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_4.4_replica_set_7e86d24c7bffe4da0a4d32580b5da0e6230b78d2_24_10_11_17_59_37?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      Caused by PYTHON-4849.

      Stack trace:

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

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: