-
Type: Build Failure
-
Resolution: Fixed
-
Priority: Unknown
-
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
- is caused by
-
PYTHON-3953 PyMongo should send killCursors on MaxTimeMSExpired Error
- Closed