From dc262b15ce0c09ddc8abca35e0b252a03c2d3a80 Mon Sep 17 00:00:00 2001 From: Cloud User Date: Mon, 22 Dec 2025 16:01:04 +0000 Subject: [PATCH 1/9] resyncing specs 12-22-2025 --- .../pool-create-min-size-error.json | 2 +- test/csot/command-execution.json | 14 +- test/csot/convenient-transactions.json | 6 +- test/csot/error-transformations.json | 6 +- test/csot/global-timeoutMS.json | 130 ++- test/csot/non-tailable-cursors.json | 6 +- test/csot/retryability-timeoutMS.json | 6 +- test/csot/runCursorCommand.json | 6 +- test/csot/sessions-inherit-timeoutMS.json | 6 +- .../errors/error_handling_handshake.json | 16 +- .../backpressure-network-error-fail.json | 140 +++ .../backpressure-network-timeout-fail.json | 143 ++++ ...ged-on-min-pool-size-population-error.json | 106 +++ .../unified/minPoolSize-error.json | 5 +- test/load_balancer/sdam-error-handling.json | 4 +- test/sessions/snapshot-sessions.json | 804 ++++++++++++++++++ 16 files changed, 1343 insertions(+), 57 deletions(-) create mode 100644 test/discovery_and_monitoring/unified/backpressure-network-error-fail.json create mode 100644 test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json create mode 100644 test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json diff --git a/test/connection_monitoring/pool-create-min-size-error.json b/test/connection_monitoring/pool-create-min-size-error.json index 1c744b850c..5c8ad02dbd 100644 --- a/test/connection_monitoring/pool-create-min-size-error.json +++ b/test/connection_monitoring/pool-create-min-size-error.json @@ -17,7 +17,7 @@ "isMaster", "hello" ], - "closeConnection": true, + "errorCode": 91, "appName": "poolCreateMinSizeErrorTest" } }, diff --git a/test/csot/command-execution.json b/test/csot/command-execution.json index aa9c3eb23f..212cd41089 100644 --- a/test/csot/command-execution.json +++ b/test/csot/command-execution.json @@ -1,6 +1,6 @@ { "description": "timeoutMS behaves correctly during command execution", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4.7", @@ -69,8 +69,10 @@ "appName": "reduceMaxTimeMSTest", "w": 1, "timeoutMS": 500, - "heartbeatFrequencyMS": 500 + "heartbeatFrequencyMS": 500, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "observeEvents": [ "commandStartedEvent" ] @@ -185,8 +187,10 @@ "appName": "rttTooHighTest", "w": 1, "timeoutMS": 10, - "heartbeatFrequencyMS": 500 + "heartbeatFrequencyMS": 500, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "observeEvents": [ "commandStartedEvent" ] @@ -316,8 +320,10 @@ "appName": "reduceMaxTimeMSTest", "w": 1, "timeoutMS": 90, - "heartbeatFrequencyMS": 100000 + "heartbeatFrequencyMS": 100000, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "observeEvents": [ "commandStartedEvent" ] diff --git a/test/csot/convenient-transactions.json b/test/csot/convenient-transactions.json index 3868b3026c..f9d03429db 100644 --- a/test/csot/convenient-transactions.json +++ b/test/csot/convenient-transactions.json @@ -1,6 +1,6 @@ { "description": "timeoutMS behaves correctly for the withTransaction API", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4", @@ -21,8 +21,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 500 + "timeoutMS": 500, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" diff --git a/test/csot/error-transformations.json b/test/csot/error-transformations.json index 4889e39583..89be49f0a4 100644 --- a/test/csot/error-transformations.json +++ b/test/csot/error-transformations.json @@ -1,6 +1,6 @@ { "description": "MaxTimeMSExpired server errors are transformed into a custom timeout error", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.0", @@ -26,8 +26,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" diff --git a/test/csot/global-timeoutMS.json b/test/csot/global-timeoutMS.json index f1edbe68e3..9d8046d1bf 100644 --- a/test/csot/global-timeoutMS.json +++ b/test/csot/global-timeoutMS.json @@ -1,6 +1,6 @@ { "description": "timeoutMS can be configured on a MongoClient", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4", @@ -38,8 +38,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -217,8 +219,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -390,8 +394,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -569,8 +575,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -762,8 +770,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -941,8 +951,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -1120,8 +1132,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -1305,8 +1319,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -1484,8 +1500,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -1663,8 +1681,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -1842,8 +1862,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2021,8 +2043,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2194,8 +2218,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2375,8 +2401,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2554,8 +2582,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2733,8 +2763,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -2906,8 +2938,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3079,8 +3113,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3258,8 +3294,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3441,8 +3479,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3628,8 +3668,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3807,8 +3849,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -3986,8 +4030,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -4171,8 +4217,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -4360,8 +4408,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -4549,8 +4599,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -4728,8 +4780,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -4913,8 +4967,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -5102,8 +5158,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -5297,8 +5355,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -5482,8 +5542,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" @@ -5677,8 +5739,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 250 + "timeoutMS": 250, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" diff --git a/test/csot/non-tailable-cursors.json b/test/csot/non-tailable-cursors.json index 291c6e72aa..58c59cb32d 100644 --- a/test/csot/non-tailable-cursors.json +++ b/test/csot/non-tailable-cursors.json @@ -1,6 +1,6 @@ { "description": "timeoutMS behaves correctly for non-tailable cursors", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4" @@ -17,8 +17,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 200 + "timeoutMS": 200, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" diff --git a/test/csot/retryability-timeoutMS.json b/test/csot/retryability-timeoutMS.json index 9daad260ef..5a0c9f3605 100644 --- a/test/csot/retryability-timeoutMS.json +++ b/test/csot/retryability-timeoutMS.json @@ -1,6 +1,6 @@ { "description": "timeoutMS behaves correctly for retryable operations", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.0", @@ -26,8 +26,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 100 + "timeoutMS": 100, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" diff --git a/test/csot/runCursorCommand.json b/test/csot/runCursorCommand.json index 36f774fb5a..e5182e338e 100644 --- a/test/csot/runCursorCommand.json +++ b/test/csot/runCursorCommand.json @@ -1,6 +1,6 @@ { "description": "runCursorCommand", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4" @@ -16,6 +16,10 @@ { "client": { "id": "commandClient", + "uriOptions": { + "minPoolSize": 1 + }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent", diff --git a/test/csot/sessions-inherit-timeoutMS.json b/test/csot/sessions-inherit-timeoutMS.json index 13ea91c794..dbf163e484 100644 --- a/test/csot/sessions-inherit-timeoutMS.json +++ b/test/csot/sessions-inherit-timeoutMS.json @@ -1,6 +1,6 @@ { "description": "sessions inherit timeoutMS from their parent MongoClient", - "schemaVersion": "1.9", + "schemaVersion": "1.26", "runOnRequirements": [ { "minServerVersion": "4.4", @@ -21,8 +21,10 @@ "client": { "id": "client", "uriOptions": { - "timeoutMS": 500 + "timeoutMS": 500, + "minPoolSize": 1 }, + "awaitMinPoolSizeMS": 10000, "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent", diff --git a/test/discovery_and_monitoring/errors/error_handling_handshake.json b/test/discovery_and_monitoring/errors/error_handling_handshake.json index 56ca7d1132..bf83f46f6a 100644 --- a/test/discovery_and_monitoring/errors/error_handling_handshake.json +++ b/test/discovery_and_monitoring/errors/error_handling_handshake.json @@ -97,14 +97,22 @@ "outcome": { "servers": { "a:27017": { - "type": "Unknown", - "topologyVersion": null, + "type": "RSPrimary", + "setName": "rs", + "topologyVersion": { + "processId": { + "$oid": "000000000000000000000001" + }, + "counter": { + "$numberLong": "1" + } + }, "pool": { - "generation": 1 + "generation": 0 } } }, - "topologyType": "ReplicaSetNoPrimary", + "topologyType": "ReplicaSetWithPrimary", "logicalSessionTimeoutMinutes": null, "setName": "rs" } diff --git a/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json new file mode 100644 index 0000000000..f41b76459c --- /dev/null +++ b/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json @@ -0,0 +1,140 @@ +{ + "description": "backpressure-network-error-fail", + "schemaVersion": "1.17", + "runOnRequirements": [ + { + "minServerVersion": "4.4", + "serverless": "forbid", + "topologies": [ + "single", + "replicaset", + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "setupClient", + "useMultipleMongoses": false + } + } + ], + "initialData": [ + { + "collectionName": "backpressure-network-error-fail", + "databaseName": "sdam-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ], + "tests": [ + { + "description": "apply backpressure on network connection errors during connection establishment", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "useMultipleMongoses": false, + "observeEvents": [ + "serverHeartbeatSucceededEvent", + "poolClearedEvent" + ], + "uriOptions": { + "retryWrites": false, + "heartbeatFrequencyMS": 1000000, + "serverMonitoringMode": "poll", + "appname": "backpressureNetworkErrorFailTest" + } + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "sdam-tests" + } + }, + { + "collection": { + "id": "collection", + "database": "database", + "collectionName": "backpressure-network-error-fail" + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "serverHeartbeatSucceededEvent": {} + }, + "count": 1 + } + }, + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "setupClient", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": "alwaysOn", + "data": { + "failCommands": [ + "isMaster", + "hello" + ], + "appName": "backpressureNetworkErrorFailTest", + "closeConnection": true + } + } + } + }, + { + "name": "insertMany", + "object": "collection", + "arguments": { + "documents": [ + { + "_id": 3 + }, + { + "_id": 4 + } + ] + }, + "expectError": { + "isError": true, + "errorLabelsContain": [ + "SystemOverloadedError", + "RetryableError" + ] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [] + } + ] + } + ] +} diff --git a/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json new file mode 100644 index 0000000000..a97c7a329f --- /dev/null +++ b/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json @@ -0,0 +1,143 @@ +{ + "description": "backpressure-network-timeout-error", + "schemaVersion": "1.17", + "runOnRequirements": [ + { + "minServerVersion": "4.4", + "serverless": "forbid", + "topologies": [ + "single", + "replicaset", + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "setupClient", + "useMultipleMongoses": false + } + } + ], + "initialData": [ + { + "collectionName": "backpressure-network-timeout-error", + "databaseName": "sdam-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ], + "tests": [ + { + "description": "apply backpressure on network timeout error during connection establishment", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "useMultipleMongoses": false, + "observeEvents": [ + "serverDescriptionChangedEvent", + "poolClearedEvent" + ], + "uriOptions": { + "retryWrites": false, + "heartbeatFrequencyMS": 1000000, + "appname": "backpressureNetworkTimeoutErrorTest", + "serverMonitoringMode": "poll", + "connectTimeoutMS": 250, + "socketTimeoutMS": 250 + } + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "sdam-tests" + } + }, + { + "collection": { + "id": "collection", + "database": "database", + "collectionName": "backpressure-network-timeout-error" + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "serverDescriptionChangedEvent": {} + }, + "count": 1 + } + }, + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "setupClient", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": "alwaysOn", + "data": { + "failCommands": [ + "isMaster", + "hello" + ], + "blockConnection": true, + "blockTimeMS": 500, + "appName": "backpressureNetworkTimeoutErrorTest" + } + } + } + }, + { + "name": "insertMany", + "object": "collection", + "arguments": { + "documents": [ + { + "_id": 3 + }, + { + "_id": 4 + } + ] + }, + "expectError": { + "isError": true, + "errorLabelsContain": [ + "SystemOverloadedError", + "RetryableError" + ] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [] + } + ] + } + ] +} diff --git a/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json b/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json new file mode 100644 index 0000000000..f0597124b7 --- /dev/null +++ b/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json @@ -0,0 +1,106 @@ +{ + "description": "backpressure-server-description-unchanged-on-min-pool-size-population-error", + "schemaVersion": "1.17", + "runOnRequirements": [ + { + "minServerVersion": "4.4", + "serverless": "forbid", + "topologies": [ + "single" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "setupClient", + "useMultipleMongoses": false + } + } + ], + "tests": [ + { + "description": "the server description is not changed on handshake error during minPoolSize population", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "setupClient", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "skip": 1 + }, + "data": { + "failCommands": [ + "hello", + "isMaster" + ], + "appName": "authErrorTest", + "closeConnection": true + } + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "serverDescriptionChangedEvent", + "connectionClosedEvent" + ], + "uriOptions": { + "appname": "authErrorTest", + "minPoolSize": 5, + "maxConnecting": 1, + "serverMonitoringMode": "poll", + "heartbeatFrequencyMS": 1000000 + } + } + } + ] + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "serverDescriptionChangedEvent": {} + }, + "count": 1 + } + }, + { + "name": "waitForEvent", + "object": "testRunner", + "arguments": { + "client": "client", + "event": { + "connectionClosedEvent": {} + }, + "count": 1 + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "sdam", + "events": [ + { + "serverDescriptionChangedEvent": {} + } + ] + } + ] + } + ] +} diff --git a/test/discovery_and_monitoring/unified/minPoolSize-error.json b/test/discovery_and_monitoring/unified/minPoolSize-error.json index bd9e9fcdec..0ce2bdd6c1 100644 --- a/test/discovery_and_monitoring/unified/minPoolSize-error.json +++ b/test/discovery_and_monitoring/unified/minPoolSize-error.json @@ -27,7 +27,7 @@ ], "tests": [ { - "description": "Network error on minPoolSize background creation", + "description": "Server error on minPoolSize background creation", "operations": [ { "name": "failPoint", @@ -45,7 +45,7 @@ "isMaster" ], "appName": "SDAMminPoolSizeError", - "closeConnection": true + "errorCode": 91 } } } @@ -68,6 +68,7 @@ "heartbeatFrequencyMS": 10000, "appname": "SDAMminPoolSizeError", "minPoolSize": 10, + "serverMonitoringMode": "poll", "serverSelectionTimeoutMS": 1000 } } diff --git a/test/load_balancer/sdam-error-handling.json b/test/load_balancer/sdam-error-handling.json index 5892dcacd6..41bc90be7f 100644 --- a/test/load_balancer/sdam-error-handling.json +++ b/test/load_balancer/sdam-error-handling.json @@ -282,7 +282,7 @@ "isMaster", "hello" ], - "closeConnection": true, + "errorCode": 11600, "appName": "lbSDAMErrorTestClient" } } @@ -297,7 +297,7 @@ } }, "expectError": { - "isClientError": true + "isError": true } } ], diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json index 260f8b6f48..8f806ea759 100644 --- a/test/sessions/snapshot-sessions.json +++ b/test/sessions/snapshot-sessions.json @@ -988,6 +988,810 @@ } } ] + }, + { + "description": "Find operation with snapshot and snapshot time", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Distinct operation with snapshot and snapshot time", + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Aggregate operation with snapshot and snapshot time", + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session0", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "countDocuments operation with snapshot and snapshot time", + "operations": [ + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": 3 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Mixed operation with snapshot and snapshotTime", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session2" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session2" + }, + "expectResult": [ + 11 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + } + ] + } + ] } ] } From 587f8a08d713960ec7c39e99a47f31c7c8708886 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 22 Dec 2025 11:50:22 -0600 Subject: [PATCH 2/9] fix handling of PYTHON-5517 --- .evergreen/remove-unimplemented-tests.sh | 3 + .evergreen/spec-patch/PYTHON-5517.patch | 473 ----------------------- 2 files changed, 3 insertions(+), 473 deletions(-) delete mode 100644 .evergreen/spec-patch/PYTHON-5517.patch diff --git a/.evergreen/remove-unimplemented-tests.sh b/.evergreen/remove-unimplemented-tests.sh index 9e049de318..794319679b 100755 --- a/.evergreen/remove-unimplemented-tests.sh +++ b/.evergreen/remove-unimplemented-tests.sh @@ -50,4 +50,7 @@ rm $PYMONGO/test/csot/override-database-timeoutMS.json # PYTHON-2943 - Socks5 Proxy Support rm $PYMONGO/test/uri_options/proxy-options.json +# PYTHON-5517 - Avoid clearing the connection pool when the server connection rate limiter triggers +rm $PYMONGO/test/discovery_and_monitoring/unified/backpressure-*.json + echo "Done removing unimplemented tests" diff --git a/.evergreen/spec-patch/PYTHON-5517.patch b/.evergreen/spec-patch/PYTHON-5517.patch deleted file mode 100644 index bc2e194271..0000000000 --- a/.evergreen/spec-patch/PYTHON-5517.patch +++ /dev/null @@ -1,473 +0,0 @@ -diff --git a/test/connection_monitoring/pool-create-min-size-error.json b/test/connection_monitoring/pool-create-min-size-error.json -index 1c744b85..5c8ad02d 100644 ---- a/test/connection_monitoring/pool-create-min-size-error.json -+++ b/test/connection_monitoring/pool-create-min-size-error.json -@@ -17,7 +17,7 @@ - "isMaster", - "hello" - ], -- "closeConnection": true, -+ "errorCode": 91, - "appName": "poolCreateMinSizeErrorTest" - } - }, -diff --git a/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json -new file mode 100644 -index 00000000..f41b7645 ---- /dev/null -+++ b/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json -@@ -0,0 +1,140 @@ -+{ -+ "description": "backpressure-network-error-fail", -+ "schemaVersion": "1.17", -+ "runOnRequirements": [ -+ { -+ "minServerVersion": "4.4", -+ "serverless": "forbid", -+ "topologies": [ -+ "single", -+ "replicaset", -+ "sharded" -+ ] -+ } -+ ], -+ "createEntities": [ -+ { -+ "client": { -+ "id": "setupClient", -+ "useMultipleMongoses": false -+ } -+ } -+ ], -+ "initialData": [ -+ { -+ "collectionName": "backpressure-network-error-fail", -+ "databaseName": "sdam-tests", -+ "documents": [ -+ { -+ "_id": 1 -+ }, -+ { -+ "_id": 2 -+ } -+ ] -+ } -+ ], -+ "tests": [ -+ { -+ "description": "apply backpressure on network connection errors during connection establishment", -+ "operations": [ -+ { -+ "name": "createEntities", -+ "object": "testRunner", -+ "arguments": { -+ "entities": [ -+ { -+ "client": { -+ "id": "client", -+ "useMultipleMongoses": false, -+ "observeEvents": [ -+ "serverHeartbeatSucceededEvent", -+ "poolClearedEvent" -+ ], -+ "uriOptions": { -+ "retryWrites": false, -+ "heartbeatFrequencyMS": 1000000, -+ "serverMonitoringMode": "poll", -+ "appname": "backpressureNetworkErrorFailTest" -+ } -+ } -+ }, -+ { -+ "database": { -+ "id": "database", -+ "client": "client", -+ "databaseName": "sdam-tests" -+ } -+ }, -+ { -+ "collection": { -+ "id": "collection", -+ "database": "database", -+ "collectionName": "backpressure-network-error-fail" -+ } -+ } -+ ] -+ } -+ }, -+ { -+ "name": "waitForEvent", -+ "object": "testRunner", -+ "arguments": { -+ "client": "client", -+ "event": { -+ "serverHeartbeatSucceededEvent": {} -+ }, -+ "count": 1 -+ } -+ }, -+ { -+ "name": "failPoint", -+ "object": "testRunner", -+ "arguments": { -+ "client": "setupClient", -+ "failPoint": { -+ "configureFailPoint": "failCommand", -+ "mode": "alwaysOn", -+ "data": { -+ "failCommands": [ -+ "isMaster", -+ "hello" -+ ], -+ "appName": "backpressureNetworkErrorFailTest", -+ "closeConnection": true -+ } -+ } -+ } -+ }, -+ { -+ "name": "insertMany", -+ "object": "collection", -+ "arguments": { -+ "documents": [ -+ { -+ "_id": 3 -+ }, -+ { -+ "_id": 4 -+ } -+ ] -+ }, -+ "expectError": { -+ "isError": true, -+ "errorLabelsContain": [ -+ "SystemOverloadedError", -+ "RetryableError" -+ ] -+ } -+ } -+ ], -+ "expectEvents": [ -+ { -+ "client": "client", -+ "eventType": "cmap", -+ "events": [] -+ } -+ ] -+ } -+ ] -+} -diff --git a/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json -new file mode 100644 -index 00000000..a97c7a32 ---- /dev/null -+++ b/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json -@@ -0,0 +1,143 @@ -+{ -+ "description": "backpressure-network-timeout-error", -+ "schemaVersion": "1.17", -+ "runOnRequirements": [ -+ { -+ "minServerVersion": "4.4", -+ "serverless": "forbid", -+ "topologies": [ -+ "single", -+ "replicaset", -+ "sharded" -+ ] -+ } -+ ], -+ "createEntities": [ -+ { -+ "client": { -+ "id": "setupClient", -+ "useMultipleMongoses": false -+ } -+ } -+ ], -+ "initialData": [ -+ { -+ "collectionName": "backpressure-network-timeout-error", -+ "databaseName": "sdam-tests", -+ "documents": [ -+ { -+ "_id": 1 -+ }, -+ { -+ "_id": 2 -+ } -+ ] -+ } -+ ], -+ "tests": [ -+ { -+ "description": "apply backpressure on network timeout error during connection establishment", -+ "operations": [ -+ { -+ "name": "createEntities", -+ "object": "testRunner", -+ "arguments": { -+ "entities": [ -+ { -+ "client": { -+ "id": "client", -+ "useMultipleMongoses": false, -+ "observeEvents": [ -+ "serverDescriptionChangedEvent", -+ "poolClearedEvent" -+ ], -+ "uriOptions": { -+ "retryWrites": false, -+ "heartbeatFrequencyMS": 1000000, -+ "appname": "backpressureNetworkTimeoutErrorTest", -+ "serverMonitoringMode": "poll", -+ "connectTimeoutMS": 250, -+ "socketTimeoutMS": 250 -+ } -+ } -+ }, -+ { -+ "database": { -+ "id": "database", -+ "client": "client", -+ "databaseName": "sdam-tests" -+ } -+ }, -+ { -+ "collection": { -+ "id": "collection", -+ "database": "database", -+ "collectionName": "backpressure-network-timeout-error" -+ } -+ } -+ ] -+ } -+ }, -+ { -+ "name": "waitForEvent", -+ "object": "testRunner", -+ "arguments": { -+ "client": "client", -+ "event": { -+ "serverDescriptionChangedEvent": {} -+ }, -+ "count": 1 -+ } -+ }, -+ { -+ "name": "failPoint", -+ "object": "testRunner", -+ "arguments": { -+ "client": "setupClient", -+ "failPoint": { -+ "configureFailPoint": "failCommand", -+ "mode": "alwaysOn", -+ "data": { -+ "failCommands": [ -+ "isMaster", -+ "hello" -+ ], -+ "blockConnection": true, -+ "blockTimeMS": 500, -+ "appName": "backpressureNetworkTimeoutErrorTest" -+ } -+ } -+ } -+ }, -+ { -+ "name": "insertMany", -+ "object": "collection", -+ "arguments": { -+ "documents": [ -+ { -+ "_id": 3 -+ }, -+ { -+ "_id": 4 -+ } -+ ] -+ }, -+ "expectError": { -+ "isError": true, -+ "errorLabelsContain": [ -+ "SystemOverloadedError", -+ "RetryableError" -+ ] -+ } -+ } -+ ], -+ "expectEvents": [ -+ { -+ "client": "client", -+ "eventType": "cmap", -+ "events": [] -+ } -+ ] -+ } -+ ] -+} -diff --git a/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json b/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json -new file mode 100644 -index 00000000..35a49c13 ---- /dev/null -+++ b/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json -@@ -0,0 +1,106 @@ -+{ -+ "description": "backpressure-server-description-unchanged-on-min-pool-size-population-error", -+ "schemaVersion": "1.17", -+ "runOnRequirements": [ -+ { -+ "minServerVersion": "4.4", -+ "serverless": "forbid", -+ "topologies": [ -+ "single" -+ ] -+ } -+ ], -+ "createEntities": [ -+ { -+ "client": { -+ "id": "setupClient", -+ "useMultipleMongoses": false -+ } -+ } -+ ], -+ "tests": [ -+ { -+ "description": "the server description is not changed on handshake error during minPoolSize population", -+ "operations": [ -+ { -+ "name": "createEntities", -+ "object": "testRunner", -+ "arguments": { -+ "entities": [ -+ { -+ "client": { -+ "id": "client", -+ "observeEvents": [ -+ "serverDescriptionChangedEvent", -+ "connectionClosedEvent" -+ ], -+ "uriOptions": { -+ "appname": "authErrorTest", -+ "minPoolSize": 5, -+ "maxConnecting": 1, -+ "serverMonitoringMode": "poll", -+ "heartbeatFrequencyMS": 1000000 -+ } -+ } -+ } -+ ] -+ } -+ }, -+ { -+ "name": "failPoint", -+ "object": "testRunner", -+ "arguments": { -+ "client": "setupClient", -+ "failPoint": { -+ "configureFailPoint": "failCommand", -+ "mode": { -+ "skip": 1 -+ }, -+ "data": { -+ "failCommands": [ -+ "hello", -+ "isMaster" -+ ], -+ "appName": "authErrorTest", -+ "closeConnection": true -+ } -+ } -+ } -+ }, -+ { -+ "name": "waitForEvent", -+ "object": "testRunner", -+ "arguments": { -+ "client": "client", -+ "event": { -+ "serverDescriptionChangedEvent": {} -+ }, -+ "count": 1 -+ } -+ }, -+ { -+ "name": "waitForEvent", -+ "object": "testRunner", -+ "arguments": { -+ "client": "client", -+ "event": { -+ "connectionClosedEvent": {} -+ }, -+ "count": 1 -+ } -+ } -+ ], -+ "expectEvents": [ -+ { -+ "client": "client", -+ "eventType": "sdam", -+ "events": [ -+ { -+ "serverDescriptionChangedEvent": {} -+ } -+ ] -+ } -+ ] -+ } -+ ] -+} -diff --git a/test/load_balancer/sdam-error-handling.json b/test/load_balancer/sdam-error-handling.json -index 5892dcac..41bc90be 100644 ---- a/test/load_balancer/sdam-error-handling.json -+++ b/test/load_balancer/sdam-error-handling.json -@@ -282,7 +282,7 @@ - "isMaster", - "hello" - ], -- "closeConnection": true, -+ "errorCode": 11600, - "appName": "lbSDAMErrorTestClient" - } - } -@@ -297,7 +297,7 @@ - } - }, - "expectError": { -- "isClientError": true -+ "isError": true - } - } - ], -diff --git a/test/discovery_and_monitoring/errors/error_handling_handshake.json b/test/discovery_and_monitoring/errors/error_handling_handshake.json -index 56ca7d11..bf83f46f 100644 ---- a/test/discovery_and_monitoring/errors/error_handling_handshake.json -+++ b/test/discovery_and_monitoring/errors/error_handling_handshake.json -@@ -97,14 +97,22 @@ - "outcome": { - "servers": { - "a:27017": { -- "type": "Unknown", -- "topologyVersion": null, -+ "type": "RSPrimary", -+ "setName": "rs", -+ "topologyVersion": { -+ "processId": { -+ "$oid": "000000000000000000000001" -+ }, -+ "counter": { -+ "$numberLong": "1" -+ } -+ }, - "pool": { -- "generation": 1 -+ "generation": 0 - } - } - }, -- "topologyType": "ReplicaSetNoPrimary", -+ "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } From bb5ff2352c1aa79305974e635a50f398edf8a9ac Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 22 Dec 2025 12:04:57 -0600 Subject: [PATCH 3/9] remove backpressure tests --- .../backpressure-network-error-fail.json | 140 ----------------- .../backpressure-network-timeout-fail.json | 143 ------------------ ...ged-on-min-pool-size-population-error.json | 106 ------------- 3 files changed, 389 deletions(-) delete mode 100644 test/discovery_and_monitoring/unified/backpressure-network-error-fail.json delete mode 100644 test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json delete mode 100644 test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json diff --git a/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json deleted file mode 100644 index f41b76459c..0000000000 --- a/test/discovery_and_monitoring/unified/backpressure-network-error-fail.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "description": "backpressure-network-error-fail", - "schemaVersion": "1.17", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "backpressure-network-error-fail", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "apply backpressure on network connection errors during connection establishment", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatSucceededEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 1000000, - "serverMonitoringMode": "poll", - "appname": "backpressureNetworkErrorFailTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "backpressure-network-error-fail" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatSucceededEvent": {} - }, - "count": 1 - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "appName": "backpressureNetworkErrorFailTest", - "closeConnection": true - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "SystemOverloadedError", - "RetryableError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [] - } - ] - } - ] -} diff --git a/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json b/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json deleted file mode 100644 index a97c7a329f..0000000000 --- a/test/discovery_and_monitoring/unified/backpressure-network-timeout-fail.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "description": "backpressure-network-timeout-error", - "schemaVersion": "1.17", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "backpressure-network-timeout-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "apply backpressure on network timeout error during connection establishment", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 1000000, - "appname": "backpressureNetworkTimeoutErrorTest", - "serverMonitoringMode": "poll", - "connectTimeoutMS": 250, - "socketTimeoutMS": 250 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "backpressure-network-timeout-error" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": {} - }, - "count": 1 - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "blockConnection": true, - "blockTimeMS": 500, - "appName": "backpressureNetworkTimeoutErrorTest" - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "SystemOverloadedError", - "RetryableError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [] - } - ] - } - ] -} diff --git a/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json b/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json deleted file mode 100644 index f0597124b7..0000000000 --- a/test/discovery_and_monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "description": "backpressure-server-description-unchanged-on-min-pool-size-population-error", - "schemaVersion": "1.17", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "tests": [ - { - "description": "the server description is not changed on handshake error during minPoolSize population", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "authErrorTest", - "closeConnection": true - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "serverDescriptionChangedEvent", - "connectionClosedEvent" - ], - "uriOptions": { - "appname": "authErrorTest", - "minPoolSize": 5, - "maxConnecting": 1, - "serverMonitoringMode": "poll", - "heartbeatFrequencyMS": 1000000 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": {} - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "connectionClosedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "events": [ - { - "serverDescriptionChangedEvent": {} - } - ] - } - ] - } - ] -} From e7801c1873dd0099fdb1266b474c0eeb05c9353d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:21:15 -0600 Subject: [PATCH 4/9] re-add patch file --- .evergreen/spec-patch/PYTHON-5517.patch | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .evergreen/spec-patch/PYTHON-5517.patch diff --git a/.evergreen/spec-patch/PYTHON-5517.patch b/.evergreen/spec-patch/PYTHON-5517.patch new file mode 100644 index 0000000000..adf453fd1f --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5517.patch @@ -0,0 +1,31 @@ +diff --git a/test/discovery_and_monitoring/errors/error_handling_handshake.json b/test/discovery_and_monitoring/errors/error_handling_handshake.json +index 56ca7d113..bf83f46f6 100644 +--- a/test/discovery_and_monitoring/errors/error_handling_handshake.json ++++ b/test/discovery_and_monitoring/errors/error_handling_handshake.json +@@ -97,14 +97,22 @@ + "outcome": { + "servers": { + "a:27017": { +- "type": "Unknown", +- "topologyVersion": null, ++ "type": "RSPrimary", ++ "setName": "rs", ++ "topologyVersion": { ++ "processId": { ++ "$oid": "000000000000000000000001" ++ }, ++ "counter": { ++ "$numberLong": "1" ++ } ++ }, + "pool": { +- "generation": 1 ++ "generation": 0 + } + } + }, +- "topologyType": "ReplicaSetNoPrimary", ++ "topologyType": "ReplicaSetWithPrimary", + "logicalSessionTimeoutMinutes": null, + "setName": "rs" + } From f9a7494e7c02902b036583a0713a33a80852099f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:33:13 -0600 Subject: [PATCH 5/9] restore test file --- .../errors/error_handling_handshake.json | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/test/discovery_and_monitoring/errors/error_handling_handshake.json b/test/discovery_and_monitoring/errors/error_handling_handshake.json index bf83f46f6a..56ca7d1132 100644 --- a/test/discovery_and_monitoring/errors/error_handling_handshake.json +++ b/test/discovery_and_monitoring/errors/error_handling_handshake.json @@ -97,22 +97,14 @@ "outcome": { "servers": { "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, + "type": "Unknown", + "topologyVersion": null, "pool": { - "generation": 0 + "generation": 1 } } }, - "topologyType": "ReplicaSetWithPrimary", + "topologyType": "ReplicaSetNoPrimary", "logicalSessionTimeoutMinutes": null, "setName": "rs" } From b76c2123a9a6fa46a67ab7ac22558be2bbbe85b2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:47:20 -0600 Subject: [PATCH 6/9] handle PYTHON-5559 --- .evergreen/remove-unimplemented-tests.sh | 1 + test/sessions/snapshot-sessions.json | 1797 ---------------------- 2 files changed, 1 insertion(+), 1797 deletions(-) delete mode 100644 test/sessions/snapshot-sessions.json diff --git a/.evergreen/remove-unimplemented-tests.sh b/.evergreen/remove-unimplemented-tests.sh index 794319679b..d81713794d 100755 --- a/.evergreen/remove-unimplemented-tests.sh +++ b/.evergreen/remove-unimplemented-tests.sh @@ -7,6 +7,7 @@ rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-application-error.j rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-checkout-error.json # PYTHON-4918 rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-min-pool-size-error.json # PYTHON-4918 rm $PYMONGO/test/client-side-encryption/spec/unified/client-bulkWrite-qe.json # PYTHON-4929 +rm $PYMONGO/test/sessions/snapshot-sessions.json # PYTHON-5559 # Python doesn't implement DRIVERS-3064 rm $PYMONGO/test/collection_management/listCollections-rawdata.json diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json deleted file mode 100644 index 8f806ea759..0000000000 --- a/test/sessions/snapshot-sessions.json +++ /dev/null @@ -1,1797 +0,0 @@ -{ - "description": "snapshot-sessions", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "findAndModify", - "insert", - "update" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "session": { - "id": "session0", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - }, - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Find operation with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 13 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 13 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Distinct operation with snapshot", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 2, - "x": 12 - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session1" - }, - "expectResult": [ - 11, - 12 - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 2, - "x": 13 - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectResult": [ - 11, - 13 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session1" - }, - "expectResult": [ - 11, - 12 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate operation with snapshot", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session1" - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 13 - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 13 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session1" - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "countDocuments operation with snapshot", - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Mixed operation with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 11 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Write commands with snapshot session do not affect snapshot reads", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 22, - "x": 33 - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "First snapshot read does not send atClusterTime", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "commandName": "find", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "StartTransaction fails in snapshot session", - "operations": [ - { - "name": "startTransaction", - "object": "session0", - "expectError": { - "isError": true, - "isClientError": true, - "errorContains": "Transactions are not supported in snapshot sessions" - } - } - ] - }, - { - "description": "Find operation with snapshot and snapshot time", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Distinct operation with snapshot and snapshot time", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Aggregate operation with snapshot and snapshot time", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session2", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session2", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "countDocuments operation with snapshot and snapshot time", - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Mixed operation with snapshot and snapshotTime", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session2" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session2" - }, - "expectResult": [ - 11 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - } - } - } - ] - } - ] - } - ] -} From 79fc8e1679f550754a1e9ebd1cff70b5212a7a07 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:50:04 -0600 Subject: [PATCH 7/9] restore test file --- test/sessions/snapshot-sessions.json | 993 +++++++++++++++++++++++++++ 1 file changed, 993 insertions(+) create mode 100644 test/sessions/snapshot-sessions.json diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json new file mode 100644 index 0000000000..260f8b6f48 --- /dev/null +++ b/test/sessions/snapshot-sessions.json @@ -0,0 +1,993 @@ +{ + "description": "snapshot-sessions", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "5.0", + "topologies": [ + "replicaset", + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "findAndModify", + "insert", + "update" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "collection0", + "collectionOptions": { + "writeConcern": { + "w": "majority" + } + } + } + }, + { + "session": { + "id": "session0", + "client": "client0", + "sessionOptions": { + "snapshot": true + } + } + }, + { + "session": { + "id": "session1", + "client": "client0", + "sessionOptions": { + "snapshot": true + } + } + } + ], + "initialData": [ + { + "collectionName": "collection0", + "databaseName": "database0", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + } + ], + "tests": [ + { + "description": "Find operation with snapshot", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 13 + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 13 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "Distinct operation with snapshot", + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session0" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 2 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 2, + "x": 12 + } + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session1" + }, + "expectResult": [ + 11, + 12 + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 2 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 2, + "x": 13 + } + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {} + }, + "expectResult": [ + 11, + 13 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session0" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session1" + }, + "expectResult": [ + 11, + 12 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "Aggregate operation with snapshot", + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session0" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session1" + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 13 + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 13 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session0" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session1" + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "countDocuments operation with snapshot", + "operations": [ + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "filter": {}, + "session": "session0" + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "filter": {}, + "session": "session0" + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "Mixed operation with snapshot", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session0" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session0" + }, + "expectResult": [ + 11 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "Write commands with snapshot session do not affect snapshot reads", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {}, + "session": "session0" + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 22, + "x": 33 + } + } + }, + { + "name": "updateOne", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + } + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "session": "session0" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": true + } + } + } + } + } + ] + } + ] + }, + { + "description": "First snapshot read does not send atClusterTime", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {}, + "session": "session0" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "commandName": "find", + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "StartTransaction fails in snapshot session", + "operations": [ + { + "name": "startTransaction", + "object": "session0", + "expectError": { + "isError": true, + "isClientError": true, + "errorContains": "Transactions are not supported in snapshot sessions" + } + } + ] + } + ] +} From c1c8b66e280eb88313b2216d9eb6e3983d4160c1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:51:13 -0600 Subject: [PATCH 8/9] fix sessions file --- test/sessions/snapshot-sessions.json | 804 +++++++++++++++++++++++++++ 1 file changed, 804 insertions(+) diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json index 260f8b6f48..8f806ea759 100644 --- a/test/sessions/snapshot-sessions.json +++ b/test/sessions/snapshot-sessions.json @@ -988,6 +988,810 @@ } } ] + }, + { + "description": "Find operation with snapshot and snapshot time", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Distinct operation with snapshot and snapshot time", + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Aggregate operation with snapshot and snapshot time", + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session0", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "countDocuments operation with snapshot and snapshot time", + "operations": [ + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": 3 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Mixed operation with snapshot and snapshotTime", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session2" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session2" + }, + "expectResult": [ + 11 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + } + ] + } + ] } ] } From 6fd8f61286c783192d43b46c7fd7ac12bd917746 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Dec 2025 07:54:45 -0600 Subject: [PATCH 9/9] restore file --- test/sessions/snapshot-sessions.json | 804 --------------------------- 1 file changed, 804 deletions(-) diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json index 8f806ea759..260f8b6f48 100644 --- a/test/sessions/snapshot-sessions.json +++ b/test/sessions/snapshot-sessions.json @@ -988,810 +988,6 @@ } } ] - }, - { - "description": "Find operation with snapshot and snapshot time", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Distinct operation with snapshot and snapshot time", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "filter": {}, - "fieldName": "x" - }, - "expectResult": [ - 11, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Aggregate operation with snapshot and snapshot time", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session2", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session2", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "countDocuments operation with snapshot and snapshot time", - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session2", - "filter": {} - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - }, - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - }, - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Mixed operation with snapshot and snapshotTime", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "getSnapshotTime", - "object": "session0", - "saveResultAsEntity": "savedSnapshotTime" - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "snapshot": true, - "snapshotTime": "savedSnapshotTime" - } - } - } - ] - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session2" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session2" - }, - "expectResult": [ - 11 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$matchesEntity": "savedSnapshotTime" - } - } - } - } - } - ] - } - ] } ] }