From 5fa566c381e9dd8fca002e10246d95fd636aa46c Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Fri, 7 Feb 2025 17:56:30 -0500 Subject: [PATCH 1/2] GODRIVER-3482 Add sessions spec tests to verify explicit sessions were created on the correct client --- ...-sessions-argument-for-correct-client.json | 600 ++++++++++++++++++ ...r-sessions-argument-for-correct-client.yml | 313 +++++++++ 2 files changed, 913 insertions(+) create mode 100644 testdata/sessions/driver-sessions-argument-for-correct-client.json create mode 100644 testdata/sessions/driver-sessions-argument-for-correct-client.yml diff --git a/testdata/sessions/driver-sessions-argument-for-correct-client.json b/testdata/sessions/driver-sessions-argument-for-correct-client.json new file mode 100644 index 0000000000..44b6f0eca4 --- /dev/null +++ b/testdata/sessions/driver-sessions-argument-for-correct-client.json @@ -0,0 +1,600 @@ +{ + "description": "driver-sessions-argument-for-correct-client", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "client": { + "id": "client1" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "session-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "session": { + "id": "session1", + "client": "client1" + } + } + ], + "tests": [ + { + "description": "Session argument is for the right client (insertOne)", + "operations": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session1", + "document": { + "_id": 2 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (insertMany)", + "operations": [ + { + "name": "insertMany", + "object": "collection0", + "arguments": { + "session": "session1", + "documents": [ + { + "_id": 1 + } + ] + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (deleteOne)", + "operations": [ + { + "name": "deleteOne", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (deleteMany)", + "operations": [ + { + "name": "deleteMany", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (updateOne)", + "operations": [ + { + "name": "updateOne", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + }, + "update": { + "$set": { + "x": 2 + } + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (updateMany)", + "operations": [ + { + "name": "updateMany", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + }, + "update": { + "$set": { + "x": 2 + } + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (updateSearchIndex)", + "operations": [ + { + "name": "updateSearchIndex", + "object": "collection0", + "arguments": { + "session": "session1", + "name": "test index", + "definition": {} + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (replaceOne)", + "operations": [ + { + "name": "replaceOne", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + }, + "replacement": { + "x": 2 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (aggregate)", + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session1", + "pipeline": [] + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (bulkWrite)", + "operations": [ + { + "name": "bulkWrite", + "object": "collection0", + "arguments": { + "session": "session1", + "requests": [] + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (estimatedDocumentCount)", + "operations": [ + { + "name": "estimatedDocumentCount", + "object": "collection0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (distinct)", + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session1", + "fieldName": "x", + "filter": {} + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (find)", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "_id": 1 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (findOne)", + "operations": [ + { + "name": "findOne", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "_id": 1 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (findOneAndDelete)", + "operations": [ + { + "name": "findOneAndDelete", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (findOneAndReplace)", + "operations": [ + { + "name": "findOneAndReplace", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + }, + "replacement": { + "x": 2 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (findOneAndUpdate)", + "operations": [ + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": { + "x": 3 + }, + "update": { + "$set": { + "x": 2 + } + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (countDocuments)", + "operations": [ + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": {} + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (createFindCursor)", + "operations": [ + { + "name": "createFindCursor", + "object": "collection0", + "arguments": { + "session": "session1", + "filter": {} + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (createIndex)", + "operations": [ + { + "name": "createIndex", + "object": "collection0", + "arguments": { + "session": "session1", + "name": "foo", + "keys": { + "x": 1 + } + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (createSearchIndex)", + "operations": [ + { + "name": "createSearchIndex", + "object": "collection0", + "arguments": { + "session": "session1", + "model": {} + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (createSearchIndexes)", + "operations": [ + { + "name": "createSearchIndexes", + "object": "collection0", + "arguments": { + "session": "session1", + "models": [] + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (dropIndex)", + "operations": [ + { + "name": "dropIndex", + "object": "collection0", + "arguments": { + "session": "session1", + "name": "x_1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (dropIndexes)", + "operations": [ + { + "name": "dropIndexes", + "object": "collection0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (dropSearchIndex)", + "operations": [ + { + "name": "dropSearchIndex", + "object": "collection0", + "arguments": { + "session": "session1", + "name": "x_1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (listIndexes)", + "operations": [ + { + "name": "listIndexes", + "object": "collection0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (listSearchIndexes)", + "operations": [ + { + "name": "listSearchIndexes", + "object": "collection0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (listCollections)", + "operations": [ + { + "name": "listCollections", + "object": "database0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (listCollectionNames)", + "operations": [ + { + "name": "listCollectionNames", + "object": "database0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (dropCollection)", + "operations": [ + { + "name": "dropCollection", + "object": "database0", + "arguments": { + "collection": "collection0", + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (listDatabases)", + "operations": [ + { + "name": "listDatabases", + "object": "client0", + "arguments": { + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + }, + { + "description": "Session argument is for the right client (clientBulkWrite)", + "runOnRequirements": [ + { + "minServerVersion": "8.0" + } + ], + "operations": [ + { + "name": "clientBulkWrite", + "object": "client0", + "arguments": { + "models": [], + "session": "session1" + }, + "expectError": { + "isClientError": true + } + } + ] + } + ] +} diff --git a/testdata/sessions/driver-sessions-argument-for-correct-client.yml b/testdata/sessions/driver-sessions-argument-for-correct-client.yml new file mode 100644 index 0000000000..33e9920506 --- /dev/null +++ b/testdata/sessions/driver-sessions-argument-for-correct-client.yml @@ -0,0 +1,313 @@ +description: driver-sessions-argument-for-correct-client + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + - client: + id: &client1 client1 + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name session-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + - session: + id: &session1 session1 + client: *client1 + +tests: + - description: Session argument is for the right client (insertOne) + operations: + - name: insertOne + object: *collection0 + arguments: + session: *session1 + document: { _id: 2 } + expectError: + isClientError: true + - description: Session argument is for the right client (insertMany) + operations: + - name: insertMany + object: *collection0 + arguments: + session: *session1 + documents: [ { _id: 1 } ] + expectError: + isClientError: true + - description: Session argument is for the right client (deleteOne) + operations: + - name: deleteOne + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + expectError: + isClientError: true + - description: Session argument is for the right client (deleteMany) + operations: + - name: deleteMany + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + expectError: + isClientError: true + - description: Session argument is for the right client (updateOne) + operations: + - name: updateOne + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + update: { $set: { x: 2 } } + expectError: + isClientError: true + - description: Session argument is for the right client (updateMany) + operations: + - name: updateMany + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + update: { $set: { x: 2 } } + expectError: + isClientError: true + - description: Session argument is for the right client (updateSearchIndex) + operations: + - name: updateSearchIndex + object: *collection0 + arguments: + session: *session1 + name: test index + definition: {} + expectError: + isClientError: true + - description: Session argument is for the right client (replaceOne) + operations: + - name: replaceOne + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + replacement: { x: 2 } + expectError: + isClientError: true + - description: Session argument is for the right client (aggregate) + operations: + - name: aggregate + object: *collection0 + arguments: + session: *session1 + pipeline: [] + expectError: + isClientError: true + - description: Session argument is for the right client (bulkWrite) + operations: + - name: bulkWrite + object: *collection0 + arguments: + session: *session1 + requests: [] + expectError: + isClientError: true + - description: Session argument is for the right client (estimatedDocumentCount) + operations: + - name: estimatedDocumentCount + object: *collection0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (distinct) + operations: + - name: distinct + object: *collection0 + arguments: + session: *session1 + fieldName: x + filter: {} + expectError: + isClientError: true + - description: Session argument is for the right client (find) + operations: + - name: find + object: *collection0 + arguments: + session: *session1 + filter: { _id: 1 } + expectError: + isClientError: true + - description: Session argument is for the right client (findOne) + operations: + - name: findOne + object: *collection0 + arguments: + session: *session1 + filter: { _id: 1 } + expectError: + isClientError: true + - description: Session argument is for the right client (findOneAndDelete) + operations: + - name: findOneAndDelete + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + expectError: + isClientError: true + - description: Session argument is for the right client (findOneAndReplace) + operations: + - name: findOneAndReplace + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + replacement: { x: 2 } + expectError: + isClientError: true + - description: Session argument is for the right client (findOneAndUpdate) + operations: + - name: findOneAndUpdate + object: *collection0 + arguments: + session: *session1 + filter: { x: 3 } + update: { $set: { x: 2 } } + expectError: + isClientError: true + - description: Session argument is for the right client (countDocuments) + operations: + - name: countDocuments + object: *collection0 + arguments: + session: *session1 + filter: {} + expectError: + isClientError: true + - description: Session argument is for the right client (createFindCursor) + operations: + - name: createFindCursor + object: *collection0 + arguments: + session: *session1 + filter: {} + expectError: + isClientError: true + - description: Session argument is for the right client (createIndex) + operations: + - name: createIndex + object: *collection0 + arguments: + session: *session1 + name: foo + keys: { x: 1 } + expectError: + isClientError: true + - description: Session argument is for the right client (createSearchIndex) + operations: + - name: createSearchIndex + object: *collection0 + arguments: + session: *session1 + model: {} + expectError: + isClientError: true + - description: Session argument is for the right client (createSearchIndexes) + operations: + - name: createSearchIndexes + object: *collection0 + arguments: + session: *session1 + models: [] + expectError: + isClientError: true + - description: Session argument is for the right client (dropIndex) + operations: + - name: dropIndex + object: *collection0 + arguments: + session: *session1 + name: x_1 + expectError: + isClientError: true + - description: Session argument is for the right client (dropIndexes) + operations: + - name: dropIndexes + object: *collection0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (dropSearchIndex) + operations: + - name: dropSearchIndex + object: *collection0 + arguments: + session: *session1 + name: x_1 + expectError: + isClientError: true + - description: Session argument is for the right client (listIndexes) + operations: + - name: listIndexes + object: *collection0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (listSearchIndexes) + operations: + - name: listSearchIndexes + object: *collection0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (listCollections) + operations: + - name: listCollections + object: *database0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (listCollectionNames) + operations: + - name: listCollectionNames + object: *database0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (dropCollection) + operations: + - name: dropCollection + object: *database0 + arguments: + collection: collection0 + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (listDatabases) + operations: + - name: listDatabases + object: *client0 + arguments: + session: *session1 + expectError: + isClientError: true + - description: Session argument is for the right client (clientBulkWrite) + runOnRequirements: + - minServerVersion: "8.0" + operations: + - name: clientBulkWrite + object: *client0 + arguments: + models: [] + session: *session1 + expectError: + isClientError: true From bc0a42ae7db611b8e6a1ddd473cd6c423231fca5 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Fri, 14 Feb 2025 17:36:50 -0500 Subject: [PATCH 2/2] combine tests --- ...-sessions-argument-for-correct-client.json | 212 +++--------------- ...r-sessions-argument-for-correct-client.yml | 62 +---- 2 files changed, 32 insertions(+), 242 deletions(-) diff --git a/testdata/sessions/driver-sessions-argument-for-correct-client.json b/testdata/sessions/driver-sessions-argument-for-correct-client.json index 44b6f0eca4..c38d4a8aaf 100644 --- a/testdata/sessions/driver-sessions-argument-for-correct-client.json +++ b/testdata/sessions/driver-sessions-argument-for-correct-client.json @@ -35,7 +35,7 @@ ], "tests": [ { - "description": "Session argument is for the right client (insertOne)", + "description": "Session argument is for the right client", "operations": [ { "name": "insertOne", @@ -49,12 +49,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (insertMany)", - "operations": [ + }, { "name": "insertMany", "object": "collection0", @@ -69,12 +64,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (deleteOne)", - "operations": [ + }, { "name": "deleteOne", "object": "collection0", @@ -87,12 +77,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (deleteMany)", - "operations": [ + }, { "name": "deleteMany", "object": "collection0", @@ -105,12 +90,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (updateOne)", - "operations": [ + }, { "name": "updateOne", "object": "collection0", @@ -128,12 +108,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (updateMany)", - "operations": [ + }, { "name": "updateMany", "object": "collection0", @@ -151,12 +126,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (updateSearchIndex)", - "operations": [ + }, { "name": "updateSearchIndex", "object": "collection0", @@ -168,12 +138,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (replaceOne)", - "operations": [ + }, { "name": "replaceOne", "object": "collection0", @@ -189,12 +154,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (aggregate)", - "operations": [ + }, { "name": "aggregate", "object": "collection0", @@ -205,12 +165,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (bulkWrite)", - "operations": [ + }, { "name": "bulkWrite", "object": "collection0", @@ -221,12 +176,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (estimatedDocumentCount)", - "operations": [ + }, { "name": "estimatedDocumentCount", "object": "collection0", @@ -236,12 +186,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (distinct)", - "operations": [ + }, { "name": "distinct", "object": "collection0", @@ -253,12 +198,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (find)", - "operations": [ + }, { "name": "find", "object": "collection0", @@ -271,12 +211,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (findOne)", - "operations": [ + }, { "name": "findOne", "object": "collection0", @@ -289,12 +224,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (findOneAndDelete)", - "operations": [ + }, { "name": "findOneAndDelete", "object": "collection0", @@ -307,12 +237,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (findOneAndReplace)", - "operations": [ + }, { "name": "findOneAndReplace", "object": "collection0", @@ -328,12 +253,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (findOneAndUpdate)", - "operations": [ + }, { "name": "findOneAndUpdate", "object": "collection0", @@ -351,12 +271,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (countDocuments)", - "operations": [ + }, { "name": "countDocuments", "object": "collection0", @@ -367,12 +282,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (createFindCursor)", - "operations": [ + }, { "name": "createFindCursor", "object": "collection0", @@ -383,12 +293,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (createIndex)", - "operations": [ + }, { "name": "createIndex", "object": "collection0", @@ -402,12 +307,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (createSearchIndex)", - "operations": [ + }, { "name": "createSearchIndex", "object": "collection0", @@ -418,12 +318,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (createSearchIndexes)", - "operations": [ + }, { "name": "createSearchIndexes", "object": "collection0", @@ -434,12 +329,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (dropIndex)", - "operations": [ + }, { "name": "dropIndex", "object": "collection0", @@ -450,12 +340,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (dropIndexes)", - "operations": [ + }, { "name": "dropIndexes", "object": "collection0", @@ -465,12 +350,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (dropSearchIndex)", - "operations": [ + }, { "name": "dropSearchIndex", "object": "collection0", @@ -481,12 +361,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (listIndexes)", - "operations": [ + }, { "name": "listIndexes", "object": "collection0", @@ -496,12 +371,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (listSearchIndexes)", - "operations": [ + }, { "name": "listSearchIndexes", "object": "collection0", @@ -511,12 +381,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (listCollections)", - "operations": [ + }, { "name": "listCollections", "object": "database0", @@ -526,12 +391,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (listCollectionNames)", - "operations": [ + }, { "name": "listCollectionNames", "object": "database0", @@ -541,12 +401,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (dropCollection)", - "operations": [ + }, { "name": "dropCollection", "object": "database0", @@ -557,12 +412,7 @@ "expectError": { "isClientError": true } - } - ] - }, - { - "description": "Session argument is for the right client (listDatabases)", - "operations": [ + }, { "name": "listDatabases", "object": "client0", diff --git a/testdata/sessions/driver-sessions-argument-for-correct-client.yml b/testdata/sessions/driver-sessions-argument-for-correct-client.yml index 33e9920506..eb71fdd434 100644 --- a/testdata/sessions/driver-sessions-argument-for-correct-client.yml +++ b/testdata/sessions/driver-sessions-argument-for-correct-client.yml @@ -20,7 +20,7 @@ createEntities: client: *client1 tests: - - description: Session argument is for the right client (insertOne) + - description: Session argument is for the right client operations: - name: insertOne object: *collection0 @@ -29,8 +29,6 @@ tests: document: { _id: 2 } expectError: isClientError: true - - description: Session argument is for the right client (insertMany) - operations: - name: insertMany object: *collection0 arguments: @@ -38,8 +36,6 @@ tests: documents: [ { _id: 1 } ] expectError: isClientError: true - - description: Session argument is for the right client (deleteOne) - operations: - name: deleteOne object: *collection0 arguments: @@ -47,8 +43,6 @@ tests: filter: { x: 3 } expectError: isClientError: true - - description: Session argument is for the right client (deleteMany) - operations: - name: deleteMany object: *collection0 arguments: @@ -56,8 +50,6 @@ tests: filter: { x: 3 } expectError: isClientError: true - - description: Session argument is for the right client (updateOne) - operations: - name: updateOne object: *collection0 arguments: @@ -66,8 +58,6 @@ tests: update: { $set: { x: 2 } } expectError: isClientError: true - - description: Session argument is for the right client (updateMany) - operations: - name: updateMany object: *collection0 arguments: @@ -76,8 +66,6 @@ tests: update: { $set: { x: 2 } } expectError: isClientError: true - - description: Session argument is for the right client (updateSearchIndex) - operations: - name: updateSearchIndex object: *collection0 arguments: @@ -86,8 +74,6 @@ tests: definition: {} expectError: isClientError: true - - description: Session argument is for the right client (replaceOne) - operations: - name: replaceOne object: *collection0 arguments: @@ -96,8 +82,6 @@ tests: replacement: { x: 2 } expectError: isClientError: true - - description: Session argument is for the right client (aggregate) - operations: - name: aggregate object: *collection0 arguments: @@ -105,8 +89,6 @@ tests: pipeline: [] expectError: isClientError: true - - description: Session argument is for the right client (bulkWrite) - operations: - name: bulkWrite object: *collection0 arguments: @@ -114,16 +96,12 @@ tests: requests: [] expectError: isClientError: true - - description: Session argument is for the right client (estimatedDocumentCount) - operations: - name: estimatedDocumentCount object: *collection0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (distinct) - operations: - name: distinct object: *collection0 arguments: @@ -132,8 +110,6 @@ tests: filter: {} expectError: isClientError: true - - description: Session argument is for the right client (find) - operations: - name: find object: *collection0 arguments: @@ -141,8 +117,6 @@ tests: filter: { _id: 1 } expectError: isClientError: true - - description: Session argument is for the right client (findOne) - operations: - name: findOne object: *collection0 arguments: @@ -150,8 +124,6 @@ tests: filter: { _id: 1 } expectError: isClientError: true - - description: Session argument is for the right client (findOneAndDelete) - operations: - name: findOneAndDelete object: *collection0 arguments: @@ -159,8 +131,6 @@ tests: filter: { x: 3 } expectError: isClientError: true - - description: Session argument is for the right client (findOneAndReplace) - operations: - name: findOneAndReplace object: *collection0 arguments: @@ -169,8 +139,6 @@ tests: replacement: { x: 2 } expectError: isClientError: true - - description: Session argument is for the right client (findOneAndUpdate) - operations: - name: findOneAndUpdate object: *collection0 arguments: @@ -179,8 +147,6 @@ tests: update: { $set: { x: 2 } } expectError: isClientError: true - - description: Session argument is for the right client (countDocuments) - operations: - name: countDocuments object: *collection0 arguments: @@ -188,8 +154,6 @@ tests: filter: {} expectError: isClientError: true - - description: Session argument is for the right client (createFindCursor) - operations: - name: createFindCursor object: *collection0 arguments: @@ -197,8 +161,6 @@ tests: filter: {} expectError: isClientError: true - - description: Session argument is for the right client (createIndex) - operations: - name: createIndex object: *collection0 arguments: @@ -207,8 +169,6 @@ tests: keys: { x: 1 } expectError: isClientError: true - - description: Session argument is for the right client (createSearchIndex) - operations: - name: createSearchIndex object: *collection0 arguments: @@ -216,8 +176,6 @@ tests: model: {} expectError: isClientError: true - - description: Session argument is for the right client (createSearchIndexes) - operations: - name: createSearchIndexes object: *collection0 arguments: @@ -225,8 +183,6 @@ tests: models: [] expectError: isClientError: true - - description: Session argument is for the right client (dropIndex) - operations: - name: dropIndex object: *collection0 arguments: @@ -234,16 +190,12 @@ tests: name: x_1 expectError: isClientError: true - - description: Session argument is for the right client (dropIndexes) - operations: - name: dropIndexes object: *collection0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (dropSearchIndex) - operations: - name: dropSearchIndex object: *collection0 arguments: @@ -251,40 +203,30 @@ tests: name: x_1 expectError: isClientError: true - - description: Session argument is for the right client (listIndexes) - operations: - name: listIndexes object: *collection0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (listSearchIndexes) - operations: - name: listSearchIndexes object: *collection0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (listCollections) - operations: - name: listCollections object: *database0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (listCollectionNames) - operations: - name: listCollectionNames object: *database0 arguments: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (dropCollection) - operations: - name: dropCollection object: *database0 arguments: @@ -292,8 +234,6 @@ tests: session: *session1 expectError: isClientError: true - - description: Session argument is for the right client (listDatabases) - operations: - name: listDatabases object: *client0 arguments: