From 3453592905301c82fd1c065a9ca669a62c0365d3 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Tue, 12 Aug 2025 18:01:40 -0600 Subject: [PATCH 1/9] Remove IndexNotFound-implicit errors --- .../tests/deprecated-options.yml | 13 ------------- .../tests/global-timeoutMS.yml | 4 ---- .../tests/override-collection-timeoutMS.yml | 8 -------- .../tests/override-database-timeoutMS.yml | 8 -------- .../tests/override-operation-timeoutMS.yml | 6 ------ 5 files changed, 39 deletions(-) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index 582a8983ae..d11268f211 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3748,11 +3748,6 @@ tests: arguments: timeoutMS: 100000 name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false - - description: "wTimeoutMS is ignored if timeoutMS is set - dropIndex on collection" operations: - name: createEntities @@ -3786,10 +3781,6 @@ tests: arguments: timeoutMS: 100000 name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: @@ -3834,10 +3825,6 @@ tests: timeoutMS: &timeoutMS 1000 maxTimeMS: 5000 name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.yml b/source/client-side-operations-timeout/tests/global-timeoutMS.yml index 7b4a78ac78..2d19840899 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.yml @@ -3124,10 +3124,6 @@ tests: object: *collection arguments: name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml index d1d1c61056..8a7f957cd4 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml @@ -1749,10 +1749,6 @@ tests: object: *collection arguments: name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: @@ -1789,10 +1785,6 @@ tests: object: *collection arguments: name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml index aed7b43720..14f751cb46 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml @@ -2347,10 +2347,6 @@ tests: object: *collection arguments: name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: @@ -2391,10 +2387,6 @@ tests: object: *collection arguments: name: "x_1" - - expectError: - isClientError: false - isTimeoutError: false expectEvents: - client: *client events: diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml index 28eabcb7c8..f3d8fb60a9 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml @@ -1817,9 +1817,6 @@ tests: arguments: timeoutMS: 1000 name: "x_1" - - expectError: - isTimeoutError: false # IndexNotFound expectEvents: - client: *client events: @@ -1847,9 +1844,6 @@ tests: arguments: timeoutMS: 0 name: "x_1" - - expectError: - isTimeoutError: false # IndexNotFound expectEvents: - client: *client events: From 37626b007e96894768822c6ff965f3dc91d6d90b Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Tue, 12 Aug 2025 18:06:36 -0600 Subject: [PATCH 2/9] Generate JSON for removing IndexNotFound-implicit errors --- .../tests/deprecated-options.json | 12 ------------ .../tests/global-timeoutMS.json | 4 ---- .../tests/override-collection-timeoutMS.json | 8 -------- .../tests/override-database-timeoutMS.json | 8 -------- .../tests/override-operation-timeoutMS.json | 6 ------ 5 files changed, 38 deletions(-) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.json b/source/client-side-operations-timeout/tests/deprecated-options.json index d3e4631ff4..438e5b6119 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.json +++ b/source/client-side-operations-timeout/tests/deprecated-options.json @@ -6756,10 +6756,6 @@ "arguments": { "timeoutMS": 100000, "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ] @@ -6821,10 +6817,6 @@ "arguments": { "timeoutMS": 100000, "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], @@ -6910,10 +6902,6 @@ "timeoutMS": 1000, "maxTimeMS": 5000, "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.json b/source/client-side-operations-timeout/tests/global-timeoutMS.json index 740bbad2e2..444177357a 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.json @@ -5626,10 +5626,6 @@ "object": "collection", "arguments": { "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json index d17e22fc2f..36d9a22f32 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json @@ -3256,10 +3256,6 @@ "object": "collection", "arguments": { "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], @@ -3332,10 +3328,6 @@ "object": "collection", "arguments": { "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json index f7fa642c58..55b7576ac4 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json @@ -4359,10 +4359,6 @@ "object": "collection", "arguments": { "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], @@ -4442,10 +4438,6 @@ "object": "collection", "arguments": { "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false } } ], diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json index 6fa0bd802a..9014b19349 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json @@ -3384,9 +3384,6 @@ "arguments": { "timeoutMS": 1000, "name": "x_1" - }, - "expectError": { - "isTimeoutError": false } } ], @@ -3442,9 +3439,6 @@ "arguments": { "timeoutMS": 0, "name": "x_1" - }, - "expectError": { - "isTimeoutError": false } } ], From 57879cc6e9cb211721334174cc98e688456a7a21 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Wed, 13 Aug 2025 12:05:17 -0600 Subject: [PATCH 3/9] Create index before dropping to avoid pre-latest IndexNotFound error --- .../tests/deprecated-options.json | 30 +++++++++++++++++++ .../tests/deprecated-options.yml | 17 ++++++++++- .../tests/global-timeoutMS.json | 10 +++++++ .../tests/global-timeoutMS.yml | 7 ++++- .../tests/override-collection-timeoutMS.json | 20 +++++++++++++ .../tests/override-collection-timeoutMS.yml | 12 +++++++- .../tests/override-database-timeoutMS.json | 20 +++++++++++++ .../tests/override-database-timeoutMS.yml | 12 +++++++- .../tests/override-operation-timeoutMS.json | 20 +++++++++++++ .../tests/override-operation-timeoutMS.yml | 12 +++++++- 10 files changed, 155 insertions(+), 5 deletions(-) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.json b/source/client-side-operations-timeout/tests/deprecated-options.json index 438e5b6119..341fd1b3a9 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.json +++ b/source/client-side-operations-timeout/tests/deprecated-options.json @@ -6811,6 +6811,16 @@ ] } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -6895,6 +6905,16 @@ ] } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -6991,6 +7011,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndexes", "object": "collection", diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index d11268f211..827a424538 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3776,6 +3776,11 @@ tests: - session: id: &session session client: *client + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -3819,6 +3824,11 @@ tests: - session: id: &session session client: *client + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -3871,6 +3881,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 5 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndexes object: *collection arguments: @@ -3966,4 +3981,4 @@ tests: command: dropIndexes: *collectionName maxTimeMS: { $$lte: *timeoutMS } - \ No newline at end of file + diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.json b/source/client-side-operations-timeout/tests/global-timeoutMS.json index 444177357a..cff465df0b 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.json @@ -5621,6 +5621,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.yml b/source/client-side-operations-timeout/tests/global-timeoutMS.yml index 2d19840899..7d90465f40 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.yml @@ -3120,6 +3120,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -3229,4 +3234,4 @@ tests: command: dropIndexes: *collectionName maxTimeMS: { $$exists: false } - \ No newline at end of file + diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json index 36d9a22f32..1fb21a82c6 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json @@ -3251,6 +3251,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -3323,6 +3333,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml index 8a7f957cd4..e8f5de31d3 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml @@ -1745,6 +1745,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -1781,6 +1786,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -1866,4 +1876,4 @@ tests: command: dropIndexes: *collectionName maxTimeMS: { $$exists: false } - \ No newline at end of file + diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json index 55b7576ac4..c994f39860 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json @@ -4354,6 +4354,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -4433,6 +4443,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml index 14f751cb46..c3bcd2d75a 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml @@ -2343,6 +2343,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -2383,6 +2388,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -2476,4 +2486,4 @@ tests: command: dropIndexes: *collectionName maxTimeMS: { $$exists: false } - \ No newline at end of file + diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json index 9014b19349..3596748650 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json @@ -3378,6 +3378,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -3433,6 +3443,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml index f3d8fb60a9..5fba6e27a9 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml @@ -1812,6 +1812,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -1839,6 +1844,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -1909,4 +1919,4 @@ tests: command: dropIndexes: *collectionName maxTimeMS: { $$exists: false } - \ No newline at end of file + From 6a3806b7ca2aa0b06b59f015a9f1bf9fed945b80 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Wed, 13 Aug 2025 13:38:56 -0600 Subject: [PATCH 4/9] Add createIndexes expected events --- .../tests/deprecated-options.json | 22 +++++++++++++++++++ .../tests/deprecated-options.yml | 15 ++++++++++++- .../tests/global-timeoutMS.json | 6 +++++ .../tests/global-timeoutMS.yml | 4 ++++ .../tests/override-collection-timeoutMS.json | 12 ++++++++++ .../tests/override-collection-timeoutMS.yml | 8 +++++++ .../tests/override-database-timeoutMS.json | 12 ++++++++++ .../tests/override-database-timeoutMS.yml | 8 +++++++ .../tests/override-operation-timeoutMS.json | 12 ++++++++++ .../tests/override-operation-timeoutMS.yml | 8 +++++++ 10 files changed, 106 insertions(+), 1 deletion(-) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.json b/source/client-side-operations-timeout/tests/deprecated-options.json index 341fd1b3a9..3fdc452fa7 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.json +++ b/source/client-side-operations-timeout/tests/deprecated-options.json @@ -6750,6 +6750,16 @@ } } }, + { + "name": "createIndex", + "object": "collection", + "arguments": { + "keys": { + "x": 1 + }, + "name": "x_1" + } + }, { "name": "dropIndex", "object": "collection", @@ -6834,6 +6844,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", @@ -6929,6 +6945,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index 827a424538..80448ada30 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3743,6 +3743,11 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 5 + - name: createIndex + object: *collection + arguments: + keys: { x: 1 } + name: "x_1" - name: dropIndex object: *collection arguments: @@ -3776,7 +3781,7 @@ tests: - session: id: &session session client: *client - - name: createIndex + - name: createIndex object: *collection arguments: keys: { x: 1 } @@ -3789,6 +3794,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName @@ -3838,6 +3847,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.json b/source/client-side-operations-timeout/tests/global-timeoutMS.json index cff465df0b..f1edbe68e3 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.json @@ -5643,6 +5643,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.yml b/source/client-side-operations-timeout/tests/global-timeoutMS.yml index 7d90465f40..667a9215f2 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.yml @@ -3132,6 +3132,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json index 1fb21a82c6..c56d45bcbb 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.json @@ -3273,6 +3273,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", @@ -3355,6 +3361,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml index e8f5de31d3..de9f413fbf 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml @@ -1757,6 +1757,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName @@ -1798,6 +1802,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json index c994f39860..11ff7a59fd 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.json @@ -4376,6 +4376,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", @@ -4465,6 +4471,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml index c3bcd2d75a..ebe2bef6fb 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml @@ -2355,6 +2355,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName @@ -2400,6 +2404,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json index 3596748650..92339e7fc0 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json @@ -3401,6 +3401,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", @@ -3466,6 +3472,12 @@ { "client": "client", "events": [ + { + "commandStartedEvent": { + "commandName": "createIndexes", + "databaseName": "test" + } + }, { "commandStartedEvent": { "commandName": "dropIndexes", diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml index 5fba6e27a9..75e5973d9e 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml @@ -1825,6 +1825,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName @@ -1857,6 +1861,10 @@ tests: expectEvents: - client: *client events: + - commandStartedEvent: + commandName: createIndexes + databaseName: *databaseName + - commandStartedEvent: commandName: dropIndexes databaseName: *databaseName From 39fc4959aca0108c9ab6c112718168b2ca676423 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Wed, 13 Aug 2025 16:17:14 -0600 Subject: [PATCH 5/9] Ensure creatIndex does not time out for dropIndex tests --- .../tests/deprecated-options.json | 2 ++ .../client-side-operations-timeout/tests/deprecated-options.yml | 2 ++ .../tests/override-operation-timeoutMS.json | 2 ++ .../tests/override-operation-timeoutMS.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.json b/source/client-side-operations-timeout/tests/deprecated-options.json index 3fdc452fa7..ec6f9a5ee7 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.json +++ b/source/client-side-operations-timeout/tests/deprecated-options.json @@ -6757,6 +6757,7 @@ "keys": { "x": 1 }, + "timeoutMS": 100000, "name": "x_1" } }, @@ -6828,6 +6829,7 @@ "keys": { "x": 1 }, + "timeoutMS": 100000, "name": "x_1" } }, diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index 80448ada30..e5e890ccce 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3747,6 +3747,7 @@ tests: object: *collection arguments: keys: { x: 1 } + timeoutMS: 100000 name: "x_1" - name: dropIndex object: *collection @@ -3785,6 +3786,7 @@ tests: object: *collection arguments: keys: { x: 1 } + timeoutMS: 100000 name: "x_1" - name: dropIndex object: *collection diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json index 92339e7fc0..f33f876137 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.json @@ -3385,6 +3385,7 @@ "keys": { "x": 1 }, + "timeoutMS": 1000, "name": "x_1" } }, @@ -3456,6 +3457,7 @@ "keys": { "x": 1 }, + "timeoutMS": 0, "name": "x_1" } }, diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml index 75e5973d9e..dc23427e7f 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml @@ -1816,6 +1816,7 @@ tests: object: *collection arguments: keys: { x: 1 } + timeoutMS: 1000 name: "x_1" - name: dropIndex object: *collection @@ -1852,6 +1853,7 @@ tests: object: *collection arguments: keys: { x: 1 } + timeoutMS: 0 name: "x_1" - name: dropIndex object: *collection From 0c86f31322773f2cd0ce3e9b84e3952472bf3c4c Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Thu, 14 Aug 2025 16:17:44 -0600 Subject: [PATCH 6/9] Add comments to createIndex operations --- .../tests/deprecated-options.yml | 8 ++++++++ .../tests/global-timeoutMS.yml | 2 ++ .../tests/override-collection-timeoutMS.yml | 4 ++++ .../tests/override-database-timeoutMS.yml | 4 ++++ .../tests/override-operation-timeoutMS.yml | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index e5e890ccce..2b2de00630 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3743,6 +3743,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 5 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -3782,6 +3784,8 @@ tests: - session: id: &session session client: *client + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -3835,6 +3839,8 @@ tests: - session: id: &session session client: *client + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -3896,6 +3902,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 5 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: diff --git a/source/client-side-operations-timeout/tests/global-timeoutMS.yml b/source/client-side-operations-timeout/tests/global-timeoutMS.yml index 667a9215f2..847c26f096 100644 --- a/source/client-side-operations-timeout/tests/global-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/global-timeoutMS.yml @@ -3120,6 +3120,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: diff --git a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml index de9f413fbf..07e2a14429 100644 --- a/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-collection-timeoutMS.yml @@ -1745,6 +1745,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -1790,6 +1792,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: diff --git a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml index ebe2bef6fb..4ded17164d 100644 --- a/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-database-timeoutMS.yml @@ -2343,6 +2343,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -2392,6 +2394,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: diff --git a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml index dc23427e7f..370e9393cf 100644 --- a/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml +++ b/source/client-side-operations-timeout/tests/override-operation-timeoutMS.yml @@ -1812,6 +1812,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: @@ -1849,6 +1851,8 @@ tests: failCommands: ["dropIndexes"] blockConnection: true blockTimeMS: 15 + # Create the index first so dropIndex doesn't return IndexNotFound on + # servers prior to 8.3. - name: createIndex object: *collection arguments: From e8d8abba5ef85abc0a0bdd055c2e958264817180 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Tue, 19 Aug 2025 10:45:44 -0600 Subject: [PATCH 7/9] Avoid generating templates that couple create-to-drop indexes --- .../etc/generate-basic-tests.py | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/source/client-side-operations-timeout/etc/generate-basic-tests.py b/source/client-side-operations-timeout/etc/generate-basic-tests.py index f52f749b8c..e70751c101 100644 --- a/source/client-side-operations-timeout/etc/generate-basic-tests.py +++ b/source/client-side-operations-timeout/etc/generate-basic-tests.py @@ -63,7 +63,7 @@ # operations. Individual generation functions can choose to include them if needed. OPERATIONS = CLIENT_OPERATIONS + DB_OPERATIONS + COLLECTION_OPERATIONS -RETRYABLE_WRITE_OPERATIONS = [op for op in OPERATIONS if op.operation_name in +RETRYABLE_WRITE_OPERATIONS = [op for op in OPERATIONS if op.operation_name in ['insertOne', 'updateOne', 'deleteOne', 'replaceOne', 'findOneAndDelete', 'findOneAndUpdate', 'findOneAndReplace', 'insertMany', 'bulkWrite'] ] @@ -102,28 +102,33 @@ def generate(name, operations): } write_yaml(name, template, injections) -def generate_global_timeout_tests(): - generate('global-timeoutMS', OPERATIONS) - -def generate_override_db(): - generate('override-database-timeoutMS', DB_OPERATIONS + COLLECTION_OPERATIONS) - -def generate_override_coll(): - generate('override-collection-timeoutMS', COLLECTION_OPERATIONS) - -def generate_override_operation(): - generate('override-operation-timeoutMS', OPERATIONS) +# TODO(DRIVERS-3266): Investigate dropping generator script for index-related +# timeoutMS tests +#def generate_global_timeout_tests(): +# generate('global-timeoutMS', OPERATIONS) +# +#def generate_override_db(): +# generate('override-database-timeoutMS', DB_OPERATIONS + COLLECTION_OPERATIONS) +# +#def generate_override_coll(): +# generate('override-collection-timeoutMS', COLLECTION_OPERATIONS) +# +#def generate_override_operation(): +# generate('override-operation-timeoutMS', OPERATIONS) +# +#def generate_deprecated(): +# generate('deprecated-options', OPERATIONS) def generate_retryable(): generate('retryability-timeoutMS', RETRYABLE_WRITE_OPERATIONS + RETRYABLE_READ_OPERATIONS) generate('retryability-legacy-timeouts', RETRYABLE_WRITE_OPERATIONS + RETRYABLE_READ_OPERATIONS) -def generate_deprecated(): - generate('deprecated-options', OPERATIONS) +# TODO(DRIVERS-3266): Investigate dropping generator script for index-related +# timeoutMS tests +#generate_global_timeout_tests() +#generate_override_db() +#generate_override_coll() +#generate_override_operation() +#generate_deprecated() -generate_global_timeout_tests() -generate_override_db() -generate_override_coll() -generate_override_operation() generate_retryable() -generate_deprecated() From d5ca578580aeac1c7a5c3ae69df63cb441e6e6a0 Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Tue, 19 Aug 2025 14:41:20 -0600 Subject: [PATCH 8/9] Update source/client-side-operations-timeout/tests/deprecated-options.yml Co-authored-by: Bailey Pearson --- .../client-side-operations-timeout/tests/deprecated-options.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.yml b/source/client-side-operations-timeout/tests/deprecated-options.yml index 2b2de00630..e3378d5fa8 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.yml +++ b/source/client-side-operations-timeout/tests/deprecated-options.yml @@ -3909,6 +3909,7 @@ tests: arguments: keys: { x: 1 } name: "x_1" + timeoutMS: 100000 - name: dropIndexes object: *collection arguments: From 05178c41a2ca21e0b9284607747fa61184cea9fc Mon Sep 17 00:00:00 2001 From: Preston Vasquez Date: Tue, 19 Aug 2025 15:53:37 -0600 Subject: [PATCH 9/9] Run source/make --- .../tests/deprecated-options.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/client-side-operations-timeout/tests/deprecated-options.json b/source/client-side-operations-timeout/tests/deprecated-options.json index ec6f9a5ee7..647e1bf792 100644 --- a/source/client-side-operations-timeout/tests/deprecated-options.json +++ b/source/client-side-operations-timeout/tests/deprecated-options.json @@ -7042,7 +7042,8 @@ "keys": { "x": 1 }, - "name": "x_1" + "name": "x_1", + "timeoutMS": 100000 } }, {