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

Test Failure - test_timeout_kills_cursor_asynchronously

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.6
    • Affects Version/s: None
    • Component/s: None
    • None

      The test added in PYTHON-3953 is failing often on macOS:

       [2023/10/25 18:36:00.643] =================================== FAILURES ===================================
       [2023/10/25 18:36:00.643] _____________ TestCursor.test_timeout_kills_cursor_asynchronously ______________
       [2023/10/25 18:36:00.643] self = <test.test_cursor.TestCursor testMethod=test_timeout_kills_cursor_asynchronously>
       [2023/10/25 18:36:00.643]     @client_context.require_failCommand_appName
       [2023/10/25 18:36:00.643]     def test_timeout_kills_cursor_asynchronously(self):
       [2023/10/25 18:36:00.643]         listener = AllowListEventListener("killCursors")
       [2023/10/25 18:36:00.643]         client = rs_or_single_client(event_listeners=[listener])
       [2023/10/25 18:36:00.643]         self.addCleanup(client.close)
       [2023/10/25 18:36:00.643]         coll = client[self.db.name].test_timeout_kills_cursor
       [2023/10/25 18:36:00.643]         # Add some test data.
       [2023/10/25 18:36:00.643]         docs_inserted = 10
       [2023/10/25 18:36:00.643]         coll.insert_many([{"i": i} for i in range(docs_inserted)])
       [2023/10/25 18:36:00.643]         listener.reset()
       [2023/10/25 18:36:00.643]         cursor = coll.find({}, batch_size=1)
       [2023/10/25 18:36:00.643]         cursor.next()
       [2023/10/25 18:36:00.643]         # Mock getMore commands timing out.
       [2023/10/25 18:36:00.643]         mock_timeout_errors = {
       [2023/10/25 18:36:00.643]             "configureFailPoint": "failCommand",
       [2023/10/25 18:36:00.643]             "mode": "alwaysOn",
       [2023/10/25 18:36:00.643]             "data": {
       [2023/10/25 18:36:00.643]                 "errorCode": 50,
       [2023/10/25 18:36:00.643]                 "failCommands": ["getMore"],
       [2023/10/25 18:36:00.643]             },
       [2023/10/25 18:36:00.643]         }
       [2023/10/25 18:36:00.643]         with self.fail_point(mock_timeout_errors):
       [2023/10/25 18:36:00.643]             with self.assertRaises(ExecutionTimeout):
       [2023/10/25 18:36:00.643]                 cursor.next()
       [2023/10/25 18:36:00.643]         def assertCursorKilled():
       [2023/10/25 18:36:00.643]             wait_until(
       [2023/10/25 18:36:00.643]                 lambda: len(client._MongoClient__kill_cursors_queue) == 0,
       [2023/10/25 18:36:00.643]                 "waited for all killCursor requests to complete",
       [2023/10/25 18:36:00.643]             )
       [2023/10/25 18:36:00.643]             self.assertEqual(1, len(listener.started_events))
       [2023/10/25 18:36:00.643]             self.assertEqual("killCursors", listener.started_events[0].command_name)
       [2023/10/25 18:36:00.643]             self.assertEqual(1, len(listener.succeeded_events))
       [2023/10/25 18:36:00.643]             self.assertEqual("killCursors", listener.succeeded_events[0].command_name)
       [2023/10/25 18:36:00.643] >       assertCursorKilled()
       [2023/10/25 18:36:00.643] test/test_cursor.py:1271:
       [2023/10/25 18:36:00.643] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2023/10/25 18:36:00.643] test/test_cursor.py:1268: in assertCursorKilled
       [2023/10/25 18:36:00.643]     self.assertEqual(1, len(listener.succeeded_events))
       [2023/10/25 18:36:00.643] E   AssertionError: 1 != 0
      

      https://spruce.mongodb.com/task/mongo_python_driver_test_macos_arm64__platform~macos_1100_arm64_auth_ssl~auth_ssl_test_7.0_standalone_patch_2431d7175741c609667892a020bc35d6506a232c_65395d8c850e612d3d275023_23_10_25_18_25_33/logs?execution=0&sortBy=STATUS&sortDir=ASC

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: