diff --git a/.gitignore b/.gitignore index c49f18f440..6511848e54 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ codereview.rc .idea/** docs_build .pytest_cache +node_modules +package-lock.json \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b562ae45fb..db6ed1322d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: - id: mdformat args: ["--wrap=120", "--number"] additional_dependencies: - [mdformat-gfm, mdformat-frontmatter, mdformat-footnote, mdformat-admon] + [mdformat-gfm, mdformat-frontmatter, mdformat-footnote, mdformat-gfm-alerts] - repo: https://github.com/tcort/markdown-link-check rev: v3.11.2 diff --git a/markdown_link_config.json b/markdown_link_config.json index f908e523f1..1d02cf54e4 100644 --- a/markdown_link_config.json +++ b/markdown_link_config.json @@ -15,6 +15,9 @@ { "pattern": "^https://github.com/10gen/mongo-enterprise-modules" }, + { + "pattern": "^https://github.com/10gen/mongohouse" + }, { "pattern": "cloudkms.googleapis.com" }, diff --git a/source/atlas-data-lake-testing/tests/README.md b/source/atlas-data-lake-testing/tests/README.md new file mode 100644 index 0000000000..f6ade52de1 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/README.md @@ -0,0 +1,70 @@ +# Atlas Data Lake Tests + +## Introduction + +The YAML and JSON files in this directory are platform-independent tests that drivers can use to assert compatibility +with [Atlas Data Lake](https://www.mongodb.com/docs/datalake/). These tests utilize the +[Unified Test Format](../../unified-test-format/unified-test-format.md). + +Several prose tests, which are not easily expressed in YAML, are also presented in this file. Those tests will need to +be manually implemented by each driver. + +## Test Considerations + +Running these integration tests will require a running `mongohoused` with data available in its `test.driverdata` +collection. See the +[ADL directory in drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools/tree/master/.evergreen/atlas_data_lake) +and [10gen/mongohouse README](https://github.com/10gen/mongohouse/blob/master/README.md) for more information. + +The test runner for Atlas Data Lake testing MUST NOT drop the collection and/or database under test. In contrast to most +other tests, which insert their own data fixtures into an empty collection, the data for these tests is specified in the +`mongohoused` configuration file. + +Additionally, the test runner MUST NOT execute `killAllSessions` (see: +[Terminating Open Transactions](../../unified-test-format/unified-test-format.md#terminating-open-transactions)) when +connected to Atlas Data Lake. + +## Prose Tests + +The following tests MUST be implemented to fully test compatibility with Atlas Data Lake. + +### 1. Support for `killCursors` command + +Test that the driver properly constructs and issues a +[killCursors](https://www.mongodb.com/docs/manual/reference/command/killCursors/) command to Atlas Data Lake. For this +test, configure an APM listener on a client and execute a query on the `test.driverdata` collection that will leave a +cursor open on the server (e.g. specify `batchSize=2` for a query that would match 3+ documents). Drivers MAY iterate +the cursor if necessary to execute the initial `find` command but MUST NOT iterate further to avoid executing a +`getMore`. + +Observe the CommandSucceededEvent event for the `find` command and extract the cursor's ID and namespace from the +response document's `cursor.id` and `cursor.ns` fields, respectively. Destroy the cursor object and observe a +CommandStartedEvent and CommandSucceededEvent for the `killCursors` command. Assert that the cursor ID and target +namespace in the outgoing command match the values from the `find` command's CommandSucceededEvent. When matching the +namespace, note that the `killCursors` field will contain the collection name and the database may be inferred from +either the `$db` field or accessed via the CommandStartedEvent directly. Finally, assert that the `killCursors` +CommandSucceededEvent indicates that the expected cursor was killed in the `cursorsKilled` field. + +Note: this test assumes that drivers only issue a `killCursors` command internally when destroying a cursor that may +still exist on the server. If a driver constructs and issues `killCursors` commands in other ways (e.g. public API), +this test MUST be adapted to test all such code paths. + +### 2. Connect without authentication + +Test that the driver can establish a connection with Atlas Data Lake without authentication. For these tests, create a +MongoClient using a valid connection string without auth credentials and execute a ping command. + +### 3. Connect with authentication + +Test that the driver can establish a connection with Atlas Data Lake with authentication. For these tests, create a +MongoClient using a valid connection string with SCRAM-SHA-1 and credentials from the drivers-evergreen-tools ADL +configuration and execute a ping command. Repeat this test using SCRAM-SHA-256. + +## Changelog + +- 2024-03-08: Convert legacy ADL tests to unified format. Convert test README from reStructuredText to Markdown. + +- 2022-10-05: Add spec front matter + +- 2020-07-15: Link to CRUD test runner implementation and note that the collection under test must not be dropped before + each test. diff --git a/source/atlas-data-lake-testing/tests/README.rst b/source/atlas-data-lake-testing/tests/README.rst deleted file mode 100644 index 2295dc391c..0000000000 --- a/source/atlas-data-lake-testing/tests/README.rst +++ /dev/null @@ -1,89 +0,0 @@ -===================== -Atlas Data Lake Tests -===================== - -:Status: Accepted -:Minimum Server Version: N/A - -.. contents:: - ----- - -Introduction -============ - -The YAML and JSON files in this directory tree are platform-independent tests -that drivers can use to assert compatibility with `Atlas Data Lake `_. - -Running these integration tests will require a running ``mongohoused`` -with data available in its ``test.driverdata`` collection. See the -`ADL directory in drivers-evergreen-tools `_ -and `10gen/mongohouse README `_ -for more information. - -Several prose tests, which are not easily expressed in YAML, are also presented -in this file. Those tests will need to be manually implemented by each driver. - -Test Format -=========== - -The same as the `CRUD Spec Test format <../../crud/tests/README.md#Test-Format>`_. - -Test Runner Implementation -========================== - -The same as the `CRUD Spec Test Runner Implementation <../../crud/tests#test-runner-implementation>`_, -with one notable differences: the test runner for Atlas Data Lake Testing -MUST NOT drop the collection and/or database under test. In contrast to other -CRUD tests, which insert their own data fixtures into an empty collection, data -for these tests is specified in the ``mongohoused`` configuration file. - -Prose Tests -=========== - -The following tests MUST be implemented to fully test compatibility with -Atlas Data Lake. - -#. Test that the driver properly constructs and issues a - `killCursors `_ - command to Atlas Data Lake. For this test, configure an APM listener on a - client and execute a query on the ``test.driverdata`` collection that will - leave a cursor open on the server (e.g. specify ``batchSize=2`` for a query - that would match 3+ documents). Drivers MAY iterate the cursor if necessary - to execute the initial ``find`` command but MUST NOT iterate further to avoid - executing a ``getMore``. - - Observe the CommandSucceededEvent event for the ``find`` command and extract - the cursor's ID and namespace from the response document's ``cursor.id`` and - ``cursor.ns`` fields, respectively. Destroy the cursor object and observe - a CommandStartedEvent and CommandSucceededEvent for the ``killCursors`` - command. Assert that the cursor ID and target namespace in the outgoing - command match the values from the ``find`` command's CommandSucceededEvent. - When matching the namespace, note that the ``killCursors`` field will contain - the collection name and the database may be inferred from either the ``$db`` - field or accessed via the CommandStartedEvent directly. Finally, assert that - the ``killCursors`` CommandSucceededEvent indicates that the expected cursor - was killed in the ``cursorsKilled`` field. - - Note: this test assumes that drivers only issue a ``killCursors`` command - internally when destroying a cursor that may still exist on the server. If - a driver constructs and issues ``killCursors`` commands in other ways (e.g. - public API), this test MUST be adapted to test all such code paths. - -#. Test that the driver can establish a connection with Atlas Data Lake - without authentication. For these tests, create a MongoClient using a - valid connection string without auth credentials and execute a ping - command. - -#. Test that the driver can establish a connection with Atlas Data Lake - with authentication. For these tests, create a MongoClient using a - valid connection string with SCRAM-SHA-1 and credentials from the - drivers-evergreen-tools ADL configuration and execute a ping command. - Repeat this test using SCRAM-SHA-256. - -Changelog -========= - -:2022-10-05: Add spec front matter -:2020-07-15: Link to CRUD test runner implementation and note that the collection - under test must not be dropped before each test. diff --git a/source/atlas-data-lake-testing/tests/aggregate.json b/source/atlas-data-lake-testing/tests/aggregate.json deleted file mode 100644 index 99995bca41..0000000000 --- a/source/atlas-data-lake-testing/tests/aggregate.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "collection_name": "driverdata", - "database_name": "test", - "tests": [ - { - "description": "Aggregate with pipeline (project, sort, limit)", - "operations": [ - { - "object": "collection", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0 - } - }, - { - "$sort": { - "a": 1 - } - }, - { - "$limit": 2 - } - ] - }, - "result": [ - { - "a": 1, - "b": 2, - "c": 3 - }, - { - "a": 2, - "b": 3, - "c": 4 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "driverdata" - } - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/aggregate.yml b/source/atlas-data-lake-testing/tests/aggregate.yml deleted file mode 100644 index bbe813987d..0000000000 --- a/source/atlas-data-lake-testing/tests/aggregate.yml +++ /dev/null @@ -1,23 +0,0 @@ -collection_name: &collection_name "driverdata" -database_name: &database_name "test" - -tests: - - - description: "Aggregate with pipeline (project, sort, limit)" - operations: - - - object: collection - name: aggregate - arguments: - pipeline: - - $project: { _id: 0 } - - $sort: { a: 1 } - - $limit: 2 - result: - - { a: 1, b: 2, c: 3 } - - { a: 2, b: 3, c: 4 } - expectations: - - - command_started_event: - command: - aggregate: *collection_name diff --git a/source/atlas-data-lake-testing/tests/estimatedDocumentCount.json b/source/atlas-data-lake-testing/tests/estimatedDocumentCount.json deleted file mode 100644 index 997a3ab3fc..0000000000 --- a/source/atlas-data-lake-testing/tests/estimatedDocumentCount.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "collection_name": "driverdata", - "database_name": "test", - "tests": [ - { - "description": "estimatedDocumentCount succeeds", - "operations": [ - { - "object": "collection", - "name": "estimatedDocumentCount", - "result": 15 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "driverdata" - }, - "command_name": "count", - "database_name": "test" - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/estimatedDocumentCount.yml b/source/atlas-data-lake-testing/tests/estimatedDocumentCount.yml deleted file mode 100644 index 64c6bbd04f..0000000000 --- a/source/atlas-data-lake-testing/tests/estimatedDocumentCount.yml +++ /dev/null @@ -1,18 +0,0 @@ -collection_name: &collection_name "driverdata" -database_name: &database_name "test" - -tests: - - - description: "estimatedDocumentCount succeeds" - operations: - - - object: collection - name: estimatedDocumentCount - result: 15 - expectations: - - - command_started_event: - command: - count: *collection_name - command_name: count - database_name: *database_name diff --git a/source/atlas-data-lake-testing/tests/find.yml b/source/atlas-data-lake-testing/tests/find.yml deleted file mode 100644 index ed0f9fd530..0000000000 --- a/source/atlas-data-lake-testing/tests/find.yml +++ /dev/null @@ -1,27 +0,0 @@ -collection_name: &collection_name "driverdata" -database_name: &database_name "test" - -tests: - - - description: "Find with projection and sort" - operations: - - - object: collection - name: find - arguments: - filter: { b: { $gt: 5 } } - projection: { _id: 0 } - sort: { a: 1 } - limit: 5 - result: - - {"a": 5, "b": 6, "c": 7} - - {"a": 6, "b": 7, "c": 8} - - {"a": 7, "b": 8, "c": 9} - - {"a": 8, "b": 9, "c": 10} - - {"a": 9, "b": 10, "c": 11} - expectations: - - - command_started_event: - command: - find: *collection_name - diff --git a/source/atlas-data-lake-testing/tests/getMore.json b/source/atlas-data-lake-testing/tests/getMore.json deleted file mode 100644 index e2e1d4788a..0000000000 --- a/source/atlas-data-lake-testing/tests/getMore.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "collection_name": "driverdata", - "database_name": "test", - "tests": [ - { - "description": "A successful find event with getMore", - "operations": [ - { - "object": "collection", - "name": "find", - "arguments": { - "filter": { - "a": { - "$gte": 2 - } - }, - "sort": { - "a": 1 - }, - "batchSize": 3, - "limit": 4 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "driverdata", - "filter": { - "a": { - "$gte": 2 - } - }, - "sort": { - "a": 1 - }, - "batchSize": 3, - "limit": 4 - }, - "command_name": "find", - "database_name": "test" - } - }, - { - "command_started_event": { - "command": { - "batchSize": 1 - }, - "command_name": "getMore", - "database_name": "cursors" - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/getMore.yml b/source/atlas-data-lake-testing/tests/getMore.yml deleted file mode 100644 index c16c1224c5..0000000000 --- a/source/atlas-data-lake-testing/tests/getMore.yml +++ /dev/null @@ -1,35 +0,0 @@ -collection_name: &collection_name "driverdata" -database_name: &database_name "test" - -tests: - - - description: "A successful find event with getMore" - operations: - - - object: collection - name: find - arguments: - filter: { a: { $gte: 2 }} - sort: { a: 1 } - batchSize: 3 - limit: 4 - expectations: - - - command_started_event: - command: - find: *collection_name - filter: { a: { $gte : 2 }} - sort: { a: 1 } - batchSize: 3 - limit: 4 - command_name: "find" - database_name: *database_name - - - command_started_event: - command: - # Assertions for "getMore" and "collection" fields are omitted, as they will have arbitrary values - # TODO: Those assertions can be added after wildcard matchers are available via SPEC-1215 - batchSize: 1 - command_name: "getMore" - # mongohoused always expects getMores on the "cursors" database - database_name: "cursors" diff --git a/source/atlas-data-lake-testing/tests/listCollections.json b/source/atlas-data-lake-testing/tests/listCollections.json deleted file mode 100644 index e419f7b3e9..0000000000 --- a/source/atlas-data-lake-testing/tests/listCollections.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "database_name": "test", - "tests": [ - { - "description": "ListCollections succeeds", - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command_name": "listCollections", - "database_name": "test", - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/listCollections.yml b/source/atlas-data-lake-testing/tests/listCollections.yml deleted file mode 100644 index 2b1fedcddb..0000000000 --- a/source/atlas-data-lake-testing/tests/listCollections.yml +++ /dev/null @@ -1,17 +0,0 @@ -database_name: &database_name "test" - -tests: - - - description: "ListCollections succeeds" - operations: - - - name: listCollections - object: database - expectations: - - - command_started_event: - command_name: "listCollections" - database_name: *database_name - command: - listCollections: 1 - diff --git a/source/atlas-data-lake-testing/tests/listDatabases.json b/source/atlas-data-lake-testing/tests/listDatabases.json deleted file mode 100644 index 6458148e49..0000000000 --- a/source/atlas-data-lake-testing/tests/listDatabases.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "tests": [ - { - "description": "ListDatabases succeeds", - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command_name": "listDatabases", - "database_name": "admin", - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/listDatabases.yml b/source/atlas-data-lake-testing/tests/listDatabases.yml deleted file mode 100644 index b6e565b90f..0000000000 --- a/source/atlas-data-lake-testing/tests/listDatabases.yml +++ /dev/null @@ -1,15 +0,0 @@ -tests: - - - description: "ListDatabases succeeds" - operations: - - - name: listDatabases - object: client - expectations: - - - command_started_event: - command_name: "listDatabases" - database_name: "admin" - command: - listDatabases: 1 - diff --git a/source/atlas-data-lake-testing/tests/runCommand.json b/source/atlas-data-lake-testing/tests/runCommand.json deleted file mode 100644 index d81ff1a64b..0000000000 --- a/source/atlas-data-lake-testing/tests/runCommand.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "database_name": "test", - "tests": [ - { - "description": "ping succeeds using runCommand", - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "ping", - "arguments": { - "command": { - "ping": 1 - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command_name": "ping", - "database_name": "test", - "command": { - "ping": 1 - } - } - } - ] - } - ] -} diff --git a/source/atlas-data-lake-testing/tests/runCommand.yml b/source/atlas-data-lake-testing/tests/runCommand.yml deleted file mode 100644 index 14435c28d5..0000000000 --- a/source/atlas-data-lake-testing/tests/runCommand.yml +++ /dev/null @@ -1,20 +0,0 @@ -database_name: &database_name "test" - -tests: - - - description: "ping succeeds using runCommand" - operations: - - - name: runCommand - object: database - command_name: ping - arguments: - command: - ping: 1 - expectations: - - - command_started_event: - command_name: ping - database_name: *database_name - command: - ping: 1 diff --git a/source/atlas-data-lake-testing/tests/unified/aggregate.json b/source/atlas-data-lake-testing/tests/unified/aggregate.json new file mode 100644 index 0000000000..68a3467c71 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/aggregate.json @@ -0,0 +1,84 @@ +{ + "description": "aggregate", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "driverdata" + } + } + ], + "tests": [ + { + "description": "Aggregate with pipeline (project, sort, limit)", + "operations": [ + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$project": { + "_id": 0 + } + }, + { + "$sort": { + "a": 1 + } + }, + { + "$limit": 2 + } + ] + }, + "expectResult": [ + { + "a": 1, + "b": 2, + "c": 3 + }, + { + "a": 2, + "b": 3, + "c": 4 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "driverdata" + }, + "commandName": "aggregate", + "databaseName": "test" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/aggregate.yml b/source/atlas-data-lake-testing/tests/unified/aggregate.yml new file mode 100644 index 0000000000..54bad5aeaa --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/aggregate.yml @@ -0,0 +1,38 @@ +description: "aggregate" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name driverdata + +tests: + - description: "Aggregate with pipeline (project, sort, limit)" + operations: + - object: *collection0 + name: aggregate + arguments: + pipeline: + - $project: { _id: 0 } + - $sort: { a: 1 } + - $limit: 2 + expectResult: + - { a: 1, b: 2, c: 3 } + - { a: 2, b: 3, c: 4 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection0Name + commandName: aggregate + databaseName: *database0Name diff --git a/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.json b/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.json new file mode 100644 index 0000000000..b7515a4418 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.json @@ -0,0 +1,56 @@ +{ + "description": "estimatedDocumentCount", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "driverdata" + } + } + ], + "tests": [ + { + "description": "estimatedDocumentCount succeeds", + "operations": [ + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 15 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "driverdata" + }, + "commandName": "count", + "databaseName": "test" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.yml b/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.yml new file mode 100644 index 0000000000..fe3c353879 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/estimatedDocumentCount.yml @@ -0,0 +1,31 @@ +description: "estimatedDocumentCount" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name driverdata + +tests: + - description: "estimatedDocumentCount succeeds" + operations: + - object: *collection0 + name: estimatedDocumentCount + expectResult: 15 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + count: *collection0Name + commandName: count + databaseName: *database0Name diff --git a/source/atlas-data-lake-testing/tests/find.json b/source/atlas-data-lake-testing/tests/unified/find.json similarity index 52% rename from source/atlas-data-lake-testing/tests/find.json rename to source/atlas-data-lake-testing/tests/unified/find.json index 8a3468a135..d0652dc720 100644 --- a/source/atlas-data-lake-testing/tests/find.json +++ b/source/atlas-data-lake-testing/tests/unified/find.json @@ -1,12 +1,36 @@ { - "collection_name": "driverdata", - "database_name": "test", + "description": "find", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "driverdata" + } + } + ], "tests": [ { "description": "Find with projection and sort", "operations": [ { - "object": "collection", + "object": "collection0", "name": "find", "arguments": { "filter": { @@ -22,7 +46,7 @@ }, "limit": 5 }, - "result": [ + "expectResult": [ { "a": 5, "b": 6, @@ -51,13 +75,20 @@ ] } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "find": "driverdata" + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "driverdata" + }, + "commandName": "find", + "databaseName": "test" + } } - } + ] } ] } diff --git a/source/atlas-data-lake-testing/tests/unified/find.yml b/source/atlas-data-lake-testing/tests/unified/find.yml new file mode 100644 index 0000000000..10384f78f4 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/find.yml @@ -0,0 +1,41 @@ +description: "find" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name driverdata + +tests: + - description: "Find with projection and sort" + operations: + - object: *collection0 + name: find + arguments: + filter: { b: { $gt: 5 } } + projection: { _id: 0 } + sort: { a: 1 } + limit: 5 + expectResult: + - { a: 5, b: 6, c: 7 } + - { a: 6, b: 7, c: 8 } + - { a: 7, b: 8, c: 9 } + - { a: 8, b: 9, c: 10 } + - { a: 9, b: 10, c: 11 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + commandName: find + databaseName: *database0Name diff --git a/source/atlas-data-lake-testing/tests/unified/getMore.json b/source/atlas-data-lake-testing/tests/unified/getMore.json new file mode 100644 index 0000000000..109b6d3d8e --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/getMore.json @@ -0,0 +1,95 @@ +{ + "description": "getMore", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "driverdata" + } + } + ], + "tests": [ + { + "description": "A successful find event with getMore", + "operations": [ + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": { + "a": { + "$gte": 2 + } + }, + "sort": { + "a": 1 + }, + "batchSize": 3, + "limit": 4 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "driverdata", + "filter": { + "a": { + "$gte": 2 + } + }, + "sort": { + "a": 1 + }, + "batchSize": 3, + "limit": 4 + }, + "commandName": "find", + "databaseName": "test" + } + }, + { + "commandStartedEvent": { + "command": { + "getMore": { + "$$type": [ + "int", + "long" + ] + }, + "collection": { + "$$type": "string" + }, + "batchSize": 1 + }, + "commandName": "getMore", + "databaseName": "cursors" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/getMore.yml b/source/atlas-data-lake-testing/tests/unified/getMore.yml new file mode 100644 index 0000000000..f02fbfe9a1 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/getMore.yml @@ -0,0 +1,48 @@ +description: "getMore" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name driverdata + +tests: + - description: "A successful find event with getMore" + operations: + - object: *collection0 + name: find + arguments: + filter: { a: { $gte: 2 } } + sort: { a: 1 } + batchSize: 3 + limit: 4 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: { a: { $gte : 2 } } + sort: { a: 1 } + batchSize: 3 + limit: 4 + commandName: find + databaseName: *database0Name + - commandStartedEvent: + command: + getMore: { $$type: [ int, long ] } + # collection name will be an internal identifier + collection: { $$type: string } + batchSize: 1 + commandName: getMore + # mongohoused always expects getMores on the "cursors" database + databaseName: cursors diff --git a/source/atlas-data-lake-testing/tests/unified/listCollections.json b/source/atlas-data-lake-testing/tests/unified/listCollections.json new file mode 100644 index 0000000000..642e7ed328 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/listCollections.json @@ -0,0 +1,48 @@ +{ + "description": "listCollections", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + } + ], + "tests": [ + { + "description": "ListCollections succeeds", + "operations": [ + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + }, + "commandName": "listCollections", + "databaseName": "test" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/listCollections.yml b/source/atlas-data-lake-testing/tests/unified/listCollections.yml new file mode 100644 index 0000000000..2b9cd1cc94 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/listCollections.yml @@ -0,0 +1,26 @@ +description: "listCollections" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + +tests: + - description: "ListCollections succeeds" + operations: + - object: *database0 + name: listCollections + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + listCollections: 1 + commandName: listCollections + databaseName: *database0Name diff --git a/source/atlas-data-lake-testing/tests/unified/listDatabases.json b/source/atlas-data-lake-testing/tests/unified/listDatabases.json new file mode 100644 index 0000000000..64506ee54e --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/listDatabases.json @@ -0,0 +1,41 @@ +{ + "description": "listDatabases", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "tests": [ + { + "description": "ListCollections succeeds", + "operations": [ + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + }, + "commandName": "listDatabases", + "databaseName": "admin" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/listDatabases.yml b/source/atlas-data-lake-testing/tests/unified/listDatabases.yml new file mode 100644 index 0000000000..cb70ee6c73 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/listDatabases.yml @@ -0,0 +1,22 @@ +description: "listDatabases" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + +tests: + - description: "ListCollections succeeds" + operations: + - object: *client0 + name: listDatabases + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + listDatabases: 1 + commandName: listDatabases + databaseName: admin diff --git a/source/atlas-data-lake-testing/tests/unified/runCommand.json b/source/atlas-data-lake-testing/tests/unified/runCommand.json new file mode 100644 index 0000000000..325b6b3f30 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/runCommand.json @@ -0,0 +1,54 @@ +{ + "description": "runCommand", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + } + ], + "tests": [ + { + "description": "ping succeeds using runCommand", + "operations": [ + { + "object": "database0", + "name": "runCommand", + "arguments": { + "command": { + "ping": 1 + }, + "commandName": "ping" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "commandName": "ping", + "databaseName": "test" + } + } + ] + } + ] + } + ] +} diff --git a/source/atlas-data-lake-testing/tests/unified/runCommand.yml b/source/atlas-data-lake-testing/tests/unified/runCommand.yml new file mode 100644 index 0000000000..8ab0d7b478 --- /dev/null +++ b/source/atlas-data-lake-testing/tests/unified/runCommand.yml @@ -0,0 +1,29 @@ +description: "runCommand" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name test + +tests: + - description: "ping succeeds using runCommand" + operations: + - object: *database0 + name: runCommand + arguments: + command: { ping: 1 } + commandName: ping + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + ping: 1 + commandName: ping + databaseName: *database0Name diff --git a/source/auth/auth.md b/source/auth/auth.md index ec6c8b0164..d96016be9e 100644 --- a/source/auth/auth.md +++ b/source/auth/auth.md @@ -859,8 +859,7 @@ The following diagram is a summary of the steps drivers MUST follow to calculate | X-MongoDB-Optional-Data\* | Optional data, base64 encoded representation of the optional object provided by the client | | Body | Action=GetCallerIdentity&Version=2011-06-15 | -> \[!NOTE\] -> +> [!NOTE] > `*`, Denotes a header that MUST be included in SignedHeaders, if present. #### Region Calculation @@ -948,8 +947,7 @@ The order in which Drivers MUST search for credentials is: 3. Using `AssumeRoleWithWebIdentity` if `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` are set. 4. The ECS endpoint if `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is set. Otherwise, the EC2 endpoint. -> \[!NOTE\] -> +> [!NOTE] > See *Should drivers support accessing Amazon EC2 instance metadata in Amazon ECS* in [Q & A](#q--a) > > Drivers are not expected to handle @@ -1153,8 +1151,7 @@ cache MUST be written atomically. If AWS authentication fails for any reason, the cache MUST be cleared. -> \[!NOTE\] -> +> [!NOTE] > Five minutes was chosen based on the AWS documentation for > [IAM roles for EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) : "We make new > credentials available at least five minutes before the expiration of the old credentials". The intent is to have some diff --git a/source/auth/tests/mongodb-aws.md b/source/auth/tests/mongodb-aws.md index 0f95a52ebf..6bfec31fde 100644 --- a/source/auth/tests/mongodb-aws.md +++ b/source/auth/tests/mongodb-aws.md @@ -39,8 +39,7 @@ URI on an EC2 machine would be: mongodb://localhost/?authMechanism=MONGODB-AWS ``` -> \[!NOTE\] -> +> [!NOTE] > No username, password or session token is passed into the URI. Drivers MUST query the EC2 instance endpoint to obtain > these credentials. @@ -53,8 +52,7 @@ would be: mongodb://localhost/?authMechanism=MONGODB-AWS ``` -> \[!NOTE\] -> +> [!NOTE] > No username, password or session token is passed into the URI. Drivers MUST query the ECS container endpoint to obtain > these credentials. @@ -87,8 +85,7 @@ mongodb://localhost/?authMechanism=MONGODB-AWS Drivers MUST test with and without AWS_ROLE_SESSION_NAME set. -> \[!NOTE\] -> +> [!NOTE] > No username, password or session token is passed into the URI. Drivers MUST check the environment variables listed above and make an @@ -125,8 +122,7 @@ export AWS_SESSION_TOKEN="" URI="mongodb://localhost/?authMechanism=MONGODB-AWS" ``` -> \[!NOTE\] -> +> [!NOTE] > No username, password or session token is passed into the URI. Drivers MUST check the environment variables listed > above for these values. If the session token is set Drivers MUST use it. diff --git a/source/auth/tests/mongodb-oidc.md b/source/auth/tests/mongodb-oidc.md index e61cdfd464..f0a2053b2a 100644 --- a/source/auth/tests/mongodb-oidc.md +++ b/source/auth/tests/mongodb-oidc.md @@ -24,8 +24,7 @@ ______________________________________________________________________ Drivers MUST implement all prose tests in this section. Unless otherwise noted, all `MongoClient` instances MUST be configured with `retryReads=false`. -> \[!NOTE\] -> +> [!NOTE] > For test cases that create fail points, drivers MUST either use a unique `appName` or explicitly remove the fail point > after the test to prevent interaction between test cases. @@ -127,8 +126,7 @@ ______________________________________________________________________ Drivers that support the [Human Authentication Flow](../auth.md#human-authentication-flow) MUST implement all prose tests in this section. Unless otherwise noted, all `MongoClient` instances MUST be configured with `retryReads=false`. -> \[!NOTE\] -> +> [!NOTE] > For test cases that create fail points, drivers MUST either use a unique `appName` or explicitly remove the fail point > after the test to prevent interaction between test cases. diff --git a/source/client-side-encryption/client-side-encryption.md b/source/client-side-encryption/client-side-encryption.md index 4d3bb0eadf..9cda038837 100644 --- a/source/client-side-encryption/client-side-encryption.md +++ b/source/client-side-encryption/client-side-encryption.md @@ -296,7 +296,7 @@ as described in [Handling of Native UUID Types](../uuid.rst). ### MongoClient Changes -
+ ```typescript class MongoClient { @@ -315,7 +315,7 @@ class MongoClient { } ``` -
+ ```typescript class AutoEncryptionOpts { @@ -423,12 +423,12 @@ Drivers MUST document that an additional `MongoClient` may be created, using the See [What's the deal with metadataClient, keyVaultClient, and the internal client?](#whats-the-deal-with-metadataclient-keyvaultclient-and-the-internal-client) -
-
-
-
-
-
+ + + + + + #### kmsProviders @@ -537,8 +537,7 @@ a name (e.g. `aws:myname`) do not support automatic credentials. Attempting to c automatic credentials results in a runtime error from [libmongocrypt](#libmongocrypt). See [Why do on-demand KMS credentials not support named KMS providers?](#why-do-on-demand-kms-credentials-not-support-named-kms-providers) -> \[!NOTE\] -> +> [!NOTE] > Drivers MUST NOT eagerly fill an empty KMS options property. Once requested, drivers MUST create a new [KMSProviders](#kmsproviders) `$P$` according to the following process: @@ -571,7 +570,7 @@ Once requested, drivers MUST create a new [KMSProviders](#kmsproviders) `$P$` ac `$t_0 + d\_{exp}$`. 6. Return `$P$` as the additional KMS providers to [libmongocrypt](#libmongocrypt). -
+ ##### Obtaining GCP Credentials @@ -596,8 +595,9 @@ Virtual machines running on the Azure platform have one or more *Managed Identit the VM, an identity can be used by obtaining an access token via HTTP from the *Azure Instance Metadata Service* (IMDS). [See this documentation for more information](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http) -> \[!NOTE\] To optimize for testability, it is recommended to implement an isolated abstraction for communication with -> IMDS. This will aide in the implementation of the prose tests of the communication with an IMDS server. +> [!NOTE] +> To optimize for testability, it is recommended to implement an isolated abstraction for communication with IMDS. This +> will aide in the implementation of the prose tests of the communication with an IMDS server. The below steps should be taken: @@ -609,7 +609,8 @@ The below steps should be taken: 04. Prepare an HTTP GET request `$Req$` based on `$U$`. - > \[!NOTE\] All query parameters on `$U$` should be appropriately percent-encoded + > [!NOTE] + > All query parameters on `$U$` should be appropriately percent-encoded 05. Add HTTP headers `Metadata: true` and `Accept: application/json` to `$Req$`. @@ -629,13 +630,11 @@ The below steps should be taken: 10. The resulting "expires in" duration `$d_{exp}$` is a count of seconds given as an ASCII-encoded integer string `expires_in` property of `$J$`. -> \[!NOTE\] -> +> [!NOTE] > If JSON decoding of `$Resp$` fails, or the `access_token` property is absent from `$J$`, this is a protocol error from > IMDS. Indicate this error to the requester of the access token. -> \[!NOTE\] -> +> [!NOTE] > If an Azure VM has more than one managed identity, requesting an access token requires additional query parameters to > disambiguate the request. For simplicity, these parameters are omitted, and only VMs that have a single managed > identity are supported. @@ -745,7 +744,7 @@ Drivers MUST implement extraOptions in a way that allows deprecating/removing op break, such as with a BSON document or map type instead of a struct type with fixed fields. See [Why are extraOptions and kmsProviders maps?](#why-are-extraoptions-and-kmsproviders-maps). -
+ ##### `extraOptions.cryptSharedLibPath` @@ -758,7 +757,7 @@ Allow the user to specify an absolute path to a [crypt_shared](#crypt_shared) dy - [Path Resolution Behavior](#path-resolution-behavior) - [Enabling crypt_shared](#enabling-crypt_shared) -
+ ##### `extraOptions.cryptSharedLibRequired` @@ -771,8 +770,8 @@ If, after initializing a `libmongocrypt_handle`, [crypt_shared](#crypt_shared) i [extraOptions.cryptSharedLibRequired](#extraoptions.cryptsharedlibrequired) is `true`, the driver MUST consider the `libmongocrypt_handle` to be invalid and return an error to the user. Refer: -
-
+ + #### encryptedFieldsMap @@ -803,7 +802,7 @@ See [Why is bypassQueryAnalysis needed?](#why-is-bypassqueryanalysis-needed). A collection supporting Queryable Encryption requires an index and three additional collections. -
+ #### Collection `encryptedFields` Lookup (GetEncryptedFields) @@ -833,8 +832,7 @@ Drivers MUST support a BSON document option named `encryptedFields` for any `Database.createCollection()`). This option will be interpreted by the helper method and MUST be passed to the [create](https://www.mongodb.com/docs/manual/reference/command/create) command. -> \[!NOTE\] -> +> [!NOTE] > Users are not expected to set the `escCollection` and `ecocCollection` options in `encryptedFields`. > [SERVER-74069](https://jira.mongodb.org/browse/SERVER-74069) added server-side validation for those fields and no > longer allows names to deviate from the following: @@ -904,8 +902,7 @@ Drivers MUST support a BSON document option named `encryptedFields` for any `Collection.drop()`). This option will only be interpreted by the helper method and MUST NOT be passed to the [drop](https://www.mongodb.com/docs/manual/reference/command/drop) command. -> \[!NOTE\] -> +> [!NOTE] > Users are not expected to set the `escCollection` and `ecocCollection` options in `encryptedFields`. > [SERVER-74069](https://jira.mongodb.org/browse/SERVER-74069) added server-side validation for those fields and no > longer allows names to deviate from the following: @@ -999,9 +996,9 @@ class ClientEncryption { } ``` -
+ -
+ ```typescript interface ClientEncryptionOpts { @@ -1213,16 +1210,16 @@ insert or query. Drivers MUST document the following behavior: > `AutoEncryptionOpts`. `AutoEncryptionOpts.bypassQueryAnalysis` may be true. `AutoEncryptionOpts.bypassAutoEncryption` > must be false. -> \[!NOTE\] The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking -> changes. +> [!NOTE] +> The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes. #### contentionFactor contentionFactor only applies when algorithm is "Indexed" or "RangePreview". It is an error to set contentionFactor when algorithm is not "Indexed" or "RangePreview". -> \[!NOTE\] The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking -> changes. +> [!NOTE] +> The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes. #### queryType @@ -1234,16 +1231,16 @@ One of the strings: queryType only applies when algorithm is "Indexed" or "RangePreview". It is an error to set queryType when algorithm is not "Indexed" or "RangePreview". -> \[!NOTE\] The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking -> changes. +> [!NOTE] +> The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes. #### rangeOpts rangeOpts only applies when algorithm is "rangePreview". It is an error to set rangeOpts when algorithm is not "rangePreview". -> \[!NOTE\] The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking -> changes. +> [!NOTE] +> The Range algorithm is experimental only. It is not intended for public use. It is subject to breaking changes. ## User facing API: When Auto Encryption Fails @@ -1366,7 +1363,7 @@ Drivers MUST propagate errors from libmongocrypt in whatever way is idiomatic to etc.). These errors MUST be distinguished in some way (e.g. exception type) to make it easier for users to distinguish when a command fails due to client side encryption. -
+ ## Enabling Command Marking with the `crypt_shared` Library @@ -1382,13 +1379,12 @@ API does not expose this full search path functionality. This extended search pa facilitate driver testing with [crypt_shared](#crypt_shared) (Refer: [Search Paths for Testing](#search-paths-for-testing) and [Path Resolution Behavior](#path-resolution-behavior)). -> \[!NOTE\] -> +> [!NOTE] > The driver MUST NOT manipulate or do any validation on the [crypt_shared](#crypt_shared) path options provided in > [extraOptions](#extraoptions). They should be passed through to [libmongocrypt](#libmongocrypt) unchanged. -
-
+ + ### Setting Search Paths @@ -1407,15 +1403,14 @@ execution from the ambient state of the host system. Refer to: [Path Resolution Behavior](#path-resolution-behavior) and [Search Paths for Testing](#search-paths-for-testing) -
+ ### Overriding the `crypt_shared` Library Path If [extraOptions.cryptSharedLibPath](#extraoptions.cryptsharedlibpath) was specified by the user, the driver MUST set the [crypt_shared](#crypt_shared) path override on the `libmongocrypt_handle`. -> \[!NOTE\] -> +> [!NOTE] > If a path override is set on a `libmongocrypt_handle` and [libmongocrypt](#libmongocrypt) fails to load > [crypt_shared](#crypt_shared) from that filepath, then that will result in a hard-error when initializing > [libmongocrypt](#libmongocrypt). @@ -1435,13 +1430,8 @@ options in [extraOptions](#extraoptions): [crypt_shared](#crypt_shared) library along with [libmongocrypt](#libmongocrypt) for creating portable application distributions without relying on a externally/globally available [crypt_shared](#crypt_shared) library. -
- -
- - Note - - No other `RPATH`/`RUNPATH`-style substitutions are available. + > [!NOTE] + > No other `RPATH`/`RUNPATH`-style substitutions are available. - If the [override path](#override-path) is given as a relative path, that path will be resolved relative to the working directory of the operating system process. @@ -1487,7 +1477,7 @@ successfully loaded by asking [libmongocrypt](#libmongocrypt) for the [crypt_sha the result is an empty string, [libmongocrypt](#libmongocrypt) did not load [crypt_shared](#crypt_shared) and the driver must rely on [mongocryptd](#mongocryptd) to mark command documents for encryption. -
+ ### "Disabling" `crypt_shared` @@ -1552,8 +1542,7 @@ If the following conditions are met: If the [extraOptions.cryptSharedLibRequired](#extraoptions.cryptsharedlibrequired) option is `true` then the driver MUST NOT attempt to spawn or connect to `mongocryptd`. -> \[!NOTE\] -> +> [!NOTE] > Since spawning [mongocryptd](#mongocryptd) requires checking whether [crypt_shared](#crypt_shared) is loaded, and > checking whether [crypt_shared](#crypt_shared) is available can only be done *after* having initialized the > `libmongocrypt_handle`, drivers will need to defer spawning [mongocryptd](#mongocryptd) until *after* initializing @@ -1592,8 +1581,7 @@ If the ClientEncryption is configured with `mongocryptdBypassSpawn=true`, then t spawning mongocryptd. If server selection ever fails when connecting to mongocryptd, the server selection error is propagated to the user. -> \[!NOTE\] -> +> [!NOTE] > A correctly-behaving driver will never attempt to connect to [mongocryptd](#mongocryptd) when > [extraOptions.cryptSharedLibRequired](#extraoptions.cryptsharedlibrequired) is set to `true` or > [crypt_shared](#crypt_shared) is loaded. diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Aggregate.yml.template index 73fe3bed8c..9dcc5b2324 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Correctness.yml.template index f6ee242b03..730245932c 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Delete.yml.template index 06078f22c5..5c407e1a42 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-FindOneAndUpdate.yml.template index f0aa47a3ce..089b42a8a6 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-InsertFind.yml.template index 742870c3c1..93e8c1a739 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Update.yml.template index fec1ce6d5c..202a3b34a2 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Aggregate.yml.template index 3d6555d822..014e46d89a 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Aggregate.yml.template @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Correctness.yml.template index 6e262102ab..8ca44929d7 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Correctness.yml.template @@ -8,6 +8,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Delete.yml.template index 34fe03533b..b208088cd7 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Delete.yml.template @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-FindOneAndUpdate.yml.template index 6c16bd0980..00abc4b259 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-FindOneAndUpdate.yml.template @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-InsertFind.yml.template index 5b031ffbd7..4d62deae8d 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-InsertFind.yml.template @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Update.yml.template index e476847069..bc36f2b40f 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Decimal-Update.yml.template @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Aggregate.yml.template index 62d97c9918..7962b27c8a 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Correctness.yml.template index 217b4c2910..415f245ce1 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Delete.yml.template index dec33f98a3..09e310d0d2 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml.template index a06c4b764e..9b4ad94ffe 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-InsertFind.yml.template index 600584c352..d16f6437b4 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Update.yml.template index 8423a59e8d..a560dc773d 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DecimalPrecision-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Aggregate.yml.template index 497e1083af..c70178396a 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Correctness.yml.template index 0f50c7e8f2..1e708f837d 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Delete.yml.template index 02723c5644..4242a4ac05 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-FindOneAndUpdate.yml.template index febcec3ef8..8ae1756f4f 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-InsertFind.yml.template index 322daf1b3e..d709bc05c5 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Update.yml.template index 241456ea6c..bdb4a88d01 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Double-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Aggregate.yml.template index 8e6d802cfd..ab3ba35953 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Correctness.yml.template index 1ce07bf297..9357acae74 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Delete.yml.template index ec28f31519..ad5fc1a613 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml.template index 5ab6f21fd9..442450e452 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-InsertFind.yml.template index d36320abdd..3c065a184d 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Update.yml.template index 3fe2d9c0e6..2e52f40af6 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-DoublePrecision-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Aggregate.yml.template index ac78449c01..15d979dc49 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Correctness.yml.template index 555e32909b..6017dc1fa9 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Delete.yml.template index b8bec2e6ea..a6058c4cbf 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-FindOneAndUpdate.yml.template index 805a127f7d..b8b7f4c6b7 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-InsertFind.yml.template index 11405f25db..3bdfe9e826 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Update.yml.template index abe3cd47b7..f0bb620324 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Int-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Aggregate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Aggregate.yml.template index 7b882e325d..8b40f4d05b 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Aggregate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Aggregate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Correctness.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Correctness.yml.template index 0d84249d4e..ef6bb9dd6c 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Correctness.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Correctness.yml.template @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Delete.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Delete.yml.template index 96889330c7..46831726a8 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Delete.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Delete.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-FindOneAndUpdate.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-FindOneAndUpdate.yml.template index cf49d021e8..88aed891d4 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-FindOneAndUpdate.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-FindOneAndUpdate.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-InsertFind.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-InsertFind.yml.template index 32c9663050..077e41957b 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-InsertFind.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-InsertFind.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Update.yml.template b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Update.yml.template index aef543e67a..55f7bfa036 100644 --- a/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Update.yml.template +++ b/source/client-side-encryption/etc/test-templates/fle2v2-Range-Long-Update.yml.template @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/subtype6.md b/source/client-side-encryption/subtype6.md index 1c8935db49..7ee1c55c57 100644 --- a/source/client-side-encryption/subtype6.md +++ b/source/client-side-encryption/subtype6.md @@ -103,7 +103,7 @@ data into one BSON value that can be treated as an opaque blob in most contexts. If we used separate subtypes, we'd need to reserve three (and possibly more in the future) of our 124 remaining subtypes. -
+ ### Why are intent-to-encrypt markings needed? diff --git a/source/client-side-encryption/tests/README.md b/source/client-side-encryption/tests/README.md index 7aa7307a82..1b6b1ab2f9 100644 --- a/source/client-side-encryption/tests/README.md +++ b/source/client-side-encryption/tests/README.md @@ -329,7 +329,8 @@ Some tests will require *not* using [crypt_shared](../client-side-encryption.rst should ensure that `crypt_shared` will not be loaded. Refer to the client-side-encryption documentation for information on "disabling" `crypt_shared` and setting library search paths. -> \[!NOTE\] The [crypt_shared](../client-side-encryption.rst#crypt_shared) dynamic library can be obtained using the +> [!NOTE] +> The [crypt_shared](../client-side-encryption.rst#crypt_shared) dynamic library can be obtained using the > [mongodl](https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/mongodl.py) Python script > from [drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools/): > @@ -978,17 +979,19 @@ The method of passing TLS options for KMIP TLS connections is driver dependent. ### 8. Bypass Spawning mongocryptd -> \[!NOTE\] CONSIDER: To reduce the chances of tests interfering with each other, drivers MAY use a different port for -> each test in this group, and include it in `--pidfilepath`. The interference may come from the fact that once spawned -> by a test, `mongocryptd` stays up and running for some time. +> [!NOTE] +> CONSIDER: To reduce the chances of tests interfering with each other, drivers MAY use a different port for each test +> in this group, and include it in `--pidfilepath`. The interference may come from the fact that once spawned by a test, +> `mongocryptd` stays up and running for some time. #### Via loading shared library The following tests that loading [crypt_shared](../client-side-encryption.rst#crypt_shared) bypasses spawning mongocryptd. -> \[!NOTE\] IMPORTANT: This test requires the [crypt_shared](../client-side-encryption.rst#crypt_shared) library be -> loaded. If the [crypt_shared](../client-side-encryption.rst#crypt_shared) library is not available, skip the test. +> [!NOTE] +> IMPORTANT: This test requires the [crypt_shared](../client-side-encryption.rst#crypt_shared) library be loaded. If the +> [crypt_shared](../client-side-encryption.rst#crypt_shared) library is not available, skip the test. 1. Create a MongoClient configured with auto encryption (referred to as `client_encrypted`) @@ -1023,13 +1026,14 @@ mongocryptd. `--port`) with serverSelectionTimeoutMS=1000. Run a handshake command and ensure it fails with a server selection timeout. -> \[!NOTE\] IMPORTANT: If [crypt_shared](../client-side-encryption.rst#crypt_shared) is visible to the operating -> system's library search mechanism, the expected server error generated by the `Via mongocryptdBypassSpawn`, -> `Via bypassAutoEncryption`, `Via bypassQueryAnalysis` tests will not appear because libmongocrypt will load the -> `crypt_shared` library instead of consulting mongocryptd. For the following tests, it is required that libmongocrypt -> *not* load `crypt_shared`. Refer to the client-side-encryption document for more information on "disabling" -> `crypt_shared`. Take into account that once loaded, for example, by another test, `crypt_shared` cannot be unloaded -> and may be used by `MongoClient`, thus making the tests misbehave in unexpected ways. +> [!NOTE] +> IMPORTANT: If [crypt_shared](../client-side-encryption.rst#crypt_shared) is visible to the operating system's library +> search mechanism, the expected server error generated by the `Via mongocryptdBypassSpawn`, `Via bypassAutoEncryption`, +> `Via bypassQueryAnalysis` tests will not appear because libmongocrypt will load the `crypt_shared` library instead of +> consulting mongocryptd. For the following tests, it is required that libmongocrypt *not* load `crypt_shared`. Refer to +> the client-side-encryption document for more information on "disabling" `crypt_shared`. Take into account that once +> loaded, for example, by another test, `crypt_shared` cannot be unloaded and may be used by `MongoClient`, thus making +> the tests misbehave in unexpected ways. #### Via mongocryptdBypassSpawn @@ -1884,7 +1888,8 @@ Expect success. The Explicit Encryption tests require MongoDB server 7.0+. The tests must not run against a standalone. -> \[!NOTE\] MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. +> [!NOTE] +> MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. > libmongocrypt 1.8.0 is configured to use the QEv2 protocol. Before running each of the following test cases, perform the following Test Setup. @@ -2622,8 +2627,9 @@ Expect the key to be successfully created. ### 20. Bypass creating mongocryptd client when shared library is loaded -> \[!NOTE\] IMPORTANT: If [crypt_shared](../client-side-encryption.rst#crypt_shared) is not visible to the operating -> system's library search mechanism, this test should be skipped. +> [!NOTE] +> IMPORTANT: If [crypt_shared](../client-side-encryption.rst#crypt_shared) is not visible to the operating system's +> library search mechanism, this test should be skipped. The following tests that a mongocryptd client is not created when shared library is in-use. @@ -2661,7 +2667,8 @@ The following tests that a mongocryptd client is not created when shared library The Automatic Data Encryption Keys tests require MongoDB server 7.0+. The tests must not run against a standalone. -> \[!NOTE\] MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. +> [!NOTE] +> MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. > libmongocrypt 1.8.0 is configured to use the QEv2 protocol. For each of the following test cases, assume `DB` is a valid open database handle, and assume a @@ -2749,8 +2756,9 @@ The [CreateEncryptedCollection](../client-side-encryption.rst#create-encrypted-c data as-is, even if it would be malformed. The server should generate an error when attempting to create a collection with such invalid settings. -> \[!NOTE\] This test is not required if the type system of the driver has a compile-time check that fields' `keyId`s -> are of the correct type. +> [!NOTE] +> This test is not required if the type system of the driver has a compile-time check that fields' `keyId`s are of the +> correct type. 1. Create a new create-collection options `$Opts$` including the following: @@ -2807,9 +2815,15 @@ This test is continuation of the case 1 and provides a way to complete inserting ### 22. Range Explicit Encryption -The Range Explicit Encryption tests require MongoDB server 7.0+. The tests must not run against a standalone. +The Range Explicit Encryption tests require MongoDB server 7.0+. The tests must not run against a standalone. The tests +must be skipped on MongoDB server 8.0+. -> \[!NOTE\] MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. +> [!NOTE] +> MongoDB Server 8.0 introduced a backwards breaking change to the Queryable Encryption (QE) range protocol: QE Range +> V2. Skip tests using `rangePreview` when using Server 8.0 or newer until DRIVERS-2767 is addressed. + +> [!NOTE] +> MongoDB Server 7.0 introduced a backwards breaking change to the Queryable Encryption (QE) protocol: QEv2. > libmongocrypt 1.8.0 is configured to use the QEv2 protocol. Each of the following test cases must pass for each of the supported types (`DecimalNoPrecision`, `DecimalPrecision`, @@ -2983,9 +2997,10 @@ Store the result in `insertPayload`. Use `clientEncryption` to decrypt `insertPayload`. Assert the returned value equals 6 and has the expected type. -> \[!NOTE\] The type returned by `clientEncryption.decrypt()` may differ from the input type to -> `clientEncryption.encrypt()` depending on how the driver unmarshals BSON numerics to language native types. Example: a -> driver may unmarshal a BSON int64 to a numeric type that does not distinguish between int64 and int32. +> [!NOTE] +> The type returned by `clientEncryption.decrypt()` may differ from the input type to `clientEncryption.encrypt()` +> depending on how the driver unmarshals BSON numerics to language native types. Example: a driver may unmarshal a BSON +> int64 to a numeric type that does not distinguish between int64 and int32. #### Case 2: can find encrypted range and return the maximum diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.json index ba53b007b5..9eaabe0d71 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.yml index 93ad199511..c0f6179445 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.json index e9620efbed..fa887e0892 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.yml index d60b7b6201..49f66ae285 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.json index daaa093896..cce4faf188 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.yml index 0b969fd48c..689d93a716 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.json index 8500fa8291..4392b67686 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.yml index 76bfe7ea25..69418e441c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.json index 7de45ba00e..27ce7881df 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.yml index e978b9de59..9ad57efa71 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.json index d5b62be062..f7d5a6af66 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.yml index fe7d050f1b..2dd35dfaa6 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Date-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.json index 081bc577fb..401ee34e3f 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.yml index 0926988d27..4debfefc80 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Aggregate.yml @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.json index 12fe7c8bc8..758d3e5732 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.yml index 1961ed3e5f..4eef897c4a 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Correctness.yml @@ -8,6 +8,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.json index ac49d16a20..24a08f318c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.yml index bdb10e2d88..aad79c5459 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Delete.yml @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.json index 88a2350786..2a8070ecf9 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.yml index defccea0aa..d71ba28c5b 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-FindOneAndUpdate.yml @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.json index 54e43e4a26..2ef63f42b9 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.yml index 51abaa6423..9e70ff9728 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-InsertFind.yml @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.json index b2b8136a9a..8064eb1b18 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.json @@ -4,7 +4,8 @@ "minServerVersion": "7.0.0", "topology": [ "replicaset" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.yml index e79fd082ec..f06c13a4eb 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Decimal-Update.yml @@ -6,6 +6,8 @@ runOn: # FLE 2 Encrypted collections are not supported on standalone. # Tests for Decimal (without precision) must only run against a replica set. Decimal (without precision) queries are expected to take a long time and may exceed the default mongos timeout. topology: [ "replicaset" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.json index b078d18172..8cf143c094 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.yml index 08f4a380cf..43f1df6864 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.json index 0859e702aa..a4b06998f7 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.yml index 18252b4bbe..c4b037bde8 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.json index 6e1ad90cd4..fad8234838 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.yml index ade385d202..cb10767df1 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.json index 1cfd19a1e8..fb8f4f4140 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml index 7100d58886..2c67b36381 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.json index da76609727..79562802e6 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.yml index 32785d6589..f01401718d 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.json index 2d201948cf..cc93b76948 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.yml index eedd076084..22beb93e94 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DecimalPrecision-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.json index c188f1f5a9..79f26660f2 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.yml index 4fb95343b0..83ca7fb90f 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.json index 3e298127dd..117e56af62 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.yml index 7289bb24dc..5f91aead18 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.json index dc0ba435f0..40d8ed5bb2 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.yml index 2f42c1da10..def2bcb67b 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.json index 4b96575e18..f0893ce661 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.yml index d6573ff862..4bac3c1382 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.json index 4827b6838f..d3dc2f830c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.yml index 0122ba243c..33b531f839 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.json index c3284ad0ff..9d6a1fbfdd 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.yml index 176db3971e..65f50aecd4 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Double-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.json index a2c1f3b75d..4188685a2c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.yml index 134003bf9c..4c3b3d66bc 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.json index d0c0601ce8..60f1ea7a33 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.yml index a8fc4ec2a4..6f3259f324 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.json index a617442ee0..4ed591d3f8 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.yml index a6f83da786..fa04447534 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.json index 5565fb179e..d8fbbfae73 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml index 5def8d287d..0f615d4b5e 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.json index a1d8c17855..4213b066d1 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.yml index 8900f79a86..107151449d 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.json index 6ea99242b1..89eb4c338d 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.yml index 3e31f40181..b8ffbe9d4d 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-DoublePrecision-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.json index b3b2826faf..686f0241ba 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.yml index 13c350ea5f..052a3006e4 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.json index 4932223ba2..2964624f22 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.yml index 1e7d5d47fc..f7e4c53dec 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.json index 03f816e4b2..531b3e7590 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.yml index ab1e9d2e5e..ecc5eaa279 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.json index d573f7b6a0..402086cdb6 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.yml index a33a5120a5..9e878890fb 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.json index 04953663fe..965b8a5516 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.yml index 4ef8c8e520..6e9594a1b6 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.json index 4c7a3c2789..6cf44ac782 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.yml index cf5716dab0..a98c1a659f 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Int-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.json index a7e77fd5c3..6edb38a800 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.yml index cb5e42c158..5bc598daa5 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Aggregate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.json index 365822c79c..3d33f7381b 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.yml index a7a33e274e..01834f1c3b 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Correctness.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.json index 17a01fe076..1b32782010 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.yml index 8dd1603f33..617794a174 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Delete.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.json index 918d0dfeed..b8e3b888a8 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.yml index 0641988b98..1459ca106c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-FindOneAndUpdate.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.json index 9fafd10d4b..d637fcf9e7 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.yml index 076670d49e..578c08c247 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-InsertFind.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.json index 20ac25bfad..1b76019a4c 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.yml index 0aad7c4416..db16c3dd64 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-Long-Update.yml @@ -5,6 +5,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.json b/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.json index 5a6e650ab4..704a693b8f 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.json +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.json @@ -6,7 +6,8 @@ "replicaset", "sharded", "load-balanced" - ] + ], + "maxServerVersion": "7.99.99" } ], "database_name": "default", diff --git a/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.yml b/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.yml index b44e8c5055..9f1a93386a 100644 --- a/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.yml +++ b/source/client-side-encryption/tests/legacy/fle2v2-Range-WrongType.yml @@ -7,6 +7,8 @@ runOn: # Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol. # FLE 2 Encrypted collections are not supported on standalone. topology: [ "replicaset", "sharded", "load-balanced" ] + # Skip tests for "rangePreview" algorithm on Server 8.0+. Server 8.0 drops "rangePreview" and adds "range". + maxServerVersion: "7.99.99" database_name: &database_name "default" collection_name: &collection_name "default" data: [] diff --git a/source/command-logging-and-monitoring/command-logging-and-monitoring.rst b/source/command-logging-and-monitoring/command-logging-and-monitoring.rst index cc1e81de2f..e65dfa3f6c 100644 --- a/source/command-logging-and-monitoring/command-logging-and-monitoring.rst +++ b/source/command-logging-and-monitoring/command-logging-and-monitoring.rst @@ -190,7 +190,7 @@ into account. See the previously mentioned MongoDB Handshake spec for details. Events API ---------- -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#events>`__ for details on the ``serviceId`` field. +See the `Load Balancer Specification <../load-balancers/load-balancers.md#events>`__ for details on the ``serviceId`` field. .. code:: typescript diff --git a/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md b/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md index 0591df58c5..00ca2899ff 100644 --- a/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md +++ b/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md @@ -717,7 +717,7 @@ MUST remove the entry for a `serviceId` once the connection count reaches 0. Onc connection MUST get the generation number that applies to its `serviceId` from the map and update the map to increment the connection count for this `serviceId`. -See the [Load Balancer Specification](../load-balancers/load-balancers.rst#connection-pooling) for details. +See the [Load Balancer Specification](../load-balancers/load-balancers.md#connection-pooling) for details. #### Forking @@ -777,7 +777,7 @@ driver. #### Events -See the [Load Balancer Specification](../load-balancers/load-balancers.rst#events) for details on the `serviceId` field. +See the [Load Balancer Specification](../load-balancers/load-balancers.md#events) for details on the `serviceId` field. ```typescript /** diff --git a/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst b/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst index a961054b09..ffdd38a7e2 100644 --- a/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst +++ b/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst @@ -782,7 +782,7 @@ Once the MongoDB handshake is done, the connection MUST get the generation number that applies to its ``serviceId`` from the map and update the map to increment the connection count for this ``serviceId``. -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#connection-pooling>`__ for details. +See the `Load Balancer Specification <../load-balancers/load-balancers.md#connection-pooling>`__ for details. Forking @@ -842,7 +842,7 @@ All drivers that implement a connection pool MUST provide an API that allows use Events ------ -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#events>`__ for details on the ``serviceId`` field. +See the `Load Balancer Specification <../load-balancers/load-balancers.md#events>`__ for details on the ``serviceId`` field. .. code:: typescript diff --git a/source/crud/crud.md b/source/crud/crud.md index 3fc5e0ad4f..009dd1859f 100644 --- a/source/crud/crud.md +++ b/source/crud/crud.md @@ -108,8 +108,7 @@ operations that return cursors MUST support the timeout options documented in th #### Read -> \[!NOTE\] -> +> [!NOTE] > The term `Iterable` is used below to indicate many of T. This spec is flexible on what that means as different > drivers will have different requirements, types, and idioms. @@ -1460,8 +1459,7 @@ The acknowledged property is defined for languages/frameworks without a sufficie choose to return an optional result (e.g. `Optional`) such that unacknowledged writes don't have a value and acknowledged writes do have a value. -> \[!NOTE\] -> +> [!NOTE] > If you have a choice, consider providing the acknowledged member and raising an error if the other fields are accessed > in an unacknowledged write. Instead of users receiving a null reference exception, you have the opportunity to provide > an informative error message indicating the correct way to handle the situation. For instance, "The insertedCount diff --git a/source/index.md b/source/index.md index 226a45e8f8..3ac8f59b36 100644 --- a/source/index.md +++ b/source/index.md @@ -19,6 +19,7 @@ - [Index Management](index-management/index-management.md) - [Initial DNS Seedlist Discovery](initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.md) - [Logging](logging/logging.md) +- [Load Balancer Support](load-balancers/load-balancers.md) - [MongoDB Driver Performance Benchmarking](benchmarking/benchmarking.md) - [Server Selection](server-selection/server-selection.md) - [Server Selection Test Plan](server-selection/server-selection-tests.md) diff --git a/source/load-balancers/load-balancers.md b/source/load-balancers/load-balancers.md new file mode 100644 index 0000000000..c5c88de4cd --- /dev/null +++ b/source/load-balancers/load-balancers.md @@ -0,0 +1,335 @@ +# Load Balancer Support + +- Status: Accepted +- Minimum Server Version: 5.0 + +______________________________________________________________________ + +## Abstract + +This specification defines driver behaviour when connected to MongoDB services through a load balancer. + +## META + +The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and +"OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt). + +## Specification + +### Terms + +#### SDAM + +An abbreviated form of "Server Discovery and Monitoring", specification defined in +[Server Discovery and Monitoring Specification](../server-discovery-and-monitoring/server-discovery-and-monitoring.rst). + +#### Service + +Any MongoDB service that can run behind a load balancer. + +### MongoClient Configuration + +#### loadBalanced + +To specify to the driver to operate in load balancing mode, a connection string option of `loadBalanced=true` MUST be +added to the connection string. This boolean option specifies whether or not the driver is connecting to a MongoDB +cluster through a load balancer. The default value MUST be false. This option MUST only be configurable at the level of +a `MongoClient`. + +#### URI Validation + +When `loadBalanced=true` is provided in the connection string, the driver MUST throw an exception in the following +cases: + +- The connection string contains more than one host/port. +- The connection string contains a `replicaSet` option. +- The connection string contains a `directConnection` option with a value of `true`. +- The connection string contains an `srvMaxHosts` option with a positive integer value. + +If a URI is provided with the `mongodb+srv` scheme, the driver MUST first do the SRV and TXT lookup and then perform the +validation. For drivers that do SRV lookup asynchronously this may result in a `MongoClient` being instantiated but +erroring later during operation execution. + +#### DNS Seedlist Discovery + +The connection string option for `loadBalanced=true` MUST be valid in a TXT record and when present MUST be validated as +defined in the URI Validation section. + +When a MongoClient is configured with an SRV URI and `loadBalanced=true`, the driver MUST NOT poll for changes in the +SRV record as is done for non-load balanced sharded clusters. + +### Server Discovery Logging and Monitoring + +
+ +#### Monitoring + +When `loadBalanced=true` is specified in the URI the topology MUST start in type `LoadBalanced` and MUST remain as +`LoadBalanced` indefinitely. The topology MUST contain 1 `ServerDescription` with a `ServerType` of - +Code:`LoadBalancer`. The "address" field of the `ServerDescription` MUST be set to the address field of the load +balancer. All other fields in the - Code:`ServerDescription` MUST remain unset. In this mode the driver MUST NOT start a +monitoring connection. The `TopologyDescription`'s `compatible` field MUST always be `true`. + +Although there is no monitoring connection in load balanced mode, drivers MUST emit the following series of SDAM events: + +- `TopologyOpeningEvent` when the topology is created. +- `TopologyDescriptionChangedEvent`. The `previousDescription` field MUST have `TopologyType` `Unknown` and no servers. + The `newDescription` MUST have `TopologyType` `LoadBalanced` and one server with `ServerType` `Unknown`. +- `ServerOpeningEvent` when the server representing the load balancer is created. +- `ServerDescriptionChangedEvent`. The `previousDescription` MUST have `ServerType` `Unknown`. The `newDescription` MUST + have `ServerType` `LoadBalancer`. +- `TopologyDescriptionChangedEvent`. The `newDescription` MUST have `TopologyType` `LoadBalanced` and one server with + `ServerType` `LoadBalancer`. + +Drivers MUST also emit a `ServerClosedEvent` and `TopologyClosedEvent` when the topology is closed and MUST NOT emit any +other events when operating in this mode. + +#### Log Messages + +SDAM events details described in [Monitoring](#monitoring) apply to corresponding log messages. Please refer to the +[SDAM logging specification](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#log-messages) +for details on SDAM logging. Drivers MUST emit the relevant SDAM log messages, such as: + +- [Starting Topology Monitoring](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#starting-topology-monitoring-log-message) +- [Stopped Topology Mmonitoring](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#stopped-topology-monitoring-log-message) +- [Starting Server Monitoring](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#starting-server-monitoring-log-message) +- [Stopped Server Monitoring](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#stopped-server-monitoring-log-message) +- [Topology Description Changed](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#topology-description-changed-log-message) + +### Driver Sessions + +#### Session Support + +When the `TopologyType` is `LoadBalanced`, sessions are always supported. + +#### Session Expiration + +When in load balancer mode, drivers MUST ignore `logicalSessionTimeoutMinutes` and MUST NOT prune client sessions from +the session pool when implemented by the driver. + +#### Data-Bearing Server Type + +A `ServerType` of `LoadBalancer` MUST be considered a data-bearing server. + +### Server Selection + +A deployment of topology type Load Balanced contains one server of type `LoadBalancer`. + +For read and write operations, the single server in the topology MUST always be selected. + +During command construction, the LoadBalancer server MUST be treated like a mongos and drivers MUST add a +`$readPreference` field to the command when required by +[Passing read preference to mongos and load balancers](../server-selection/server-selection.md#passing-read-preference-to-mongos-and-load-balancers). + +### Connection Pooling + +#### Connection Establishment + +In the case of the driver having the `loadBalanced=true` connection string option specified, every pooled connection +MUST add a `loadBalanced` field to the - Code:`hello` command in its +[handshake](../mongodb-handshake/handshake.rst#connection-handshake). The value of the field MUST be `true`. If +`loadBalanced=true` is specified then the `OP_MSG` protocol MUST be used for all steps of the connection handshake. + +Example: + +Driver connection string contains `loadBalanced=true`: + +```typescript +{ hello: 1, loadBalanced: true } +``` + +Driver connection string contains `loadBalanced=false` or no - Code:`loadBalanced` option: + +```typescript +{ hello: 1 } +``` + +When the server's hello response does not contain a `serviceId` field, the driver MUST throw an exception with the +message "Driver attempted to initialize in load balancing mode, but the server does not support this mode." + +For single threaded drivers that do not use a connection pool, the driver MUST have only 1 socket connection to the load +balancer in load balancing mode. + +#### Connection Pinning + +Some features in MongoDB such as cursors and transactions require sending multiple commands to the same mongos in a +sharded cluster. In load balanced mode, it is not possible to target the same mongos behind a load balancer when pooling +connections. To account for this, drivers MUST pin to a single connection for these features. When using a pinned +connection, the driver MUST emit only 1 - Code:`ConnectionCheckOutStartedEvent`, and only 1 `ConnectionCheckedOutEvent` +or `ConnectionCheckOutFailedEvent`. Similarly, the driver MUST only publish 1 - Code:`ConnectionCheckedInEvent`. + +#### Behaviour With Cursors + +When the driver is in load balancing mode and executing any cursor-initiating command, the driver MUST NOT check the +connection back into the pool unless the command fails or the server returns a cursor ID of `0` (i.e. all documents are +returned in a single batch). Otherwise, the driver MUST continue to use the same connection for all subsequent - +Code:`getMore` commands for the cursor. The driver MUST check the connection back into the pool if the server returns a +cursor ID of `0` in a `getMore` response (i.e. the cursor is drained). When the cursor's `close` method is invoked, +either explicitly or via an implicit resource cleanup mechanism, the driver MUST use the same connection to execute a +`killCursors` command if necessary and then check the connection back into the pool regardless of the result. + +For multi-threaded drivers, cursors with pinned connections MUST either document to the user that calling `next()` and +`close()` operations on the cursor concurrently is not permitted, or explicitly prevent cursors from executing those +operations simultaneously. + +If a `getMore` fails with a network error, drivers MUST leave the connection pinned to the cursor. When the cursor's +`close` method is invoked, drivers MUST NOT execute a `killCursors` command because the pinned connection is no longer +valid and MUST return the connection back to the pool. + +#### Behaviour With Transactions + +When executing a transaction in load balancing mode, drivers MUST follow the rules outlined in +[Sharded Transactions](../transactions/transactions.md#sharded-transactions) with one exception: drivers MUST use the +same connection for all commands in the transaction (excluding retries of commitTranscation and abortTransaction in some +cases). Pinning to a single connection ensures that all commands in the transaction target the same service behind the +load balancer. The rules for pinning to a connection and releasing a pinned connection are the same as those for server +pinning in non-load balanced sharded transactions as described in +[When to unpin](../transactions/transactions.md#when-to-unpin). Drivers MUST NOT use the same connection for two +concurrent transactions run under different sessions from the same client. + +#### Connection Tracking + +The driver connection pool MUST track the purpose for which connections are checked out in the following 3 categories: + +- Connections checked out for cursors +- Connections checked out for transactions +- Connections checked out for operations not falling under the previous 2 categories + +When the connection pool's `maxPoolSize` is reached and the pool times out waiting for a new connection the +`WaitQueueTimeoutError` MUST include a new detailed message, "Timeout waiting for connection from the connection pool. +maxPoolSize: n, connections in use by cursors: n, connections in use by transactions: n, connections in use by other +operations: n". + +### Error Handling + +#### Initial Handshake Errors + +When establishing a new connection in load balanced mode, drivers MUST NOT perform SDAM error handling for any errors +that occur before the MongoDB Handshake (i.e. `hello` command) is complete. Errors during the MongoDB Handshake MUST +also be ignored for SDAM error handling purposes. Once the initial handshake is complete, the connection MUST determine +its generation number based on the `serviceId` field in the handshake response. Any errors that occur during the rest of +connection establishment (e.g. errors during authentication commands) MUST go through the SDAM error handling flow but +MUST NOT mark the server as - Code:`Unknown` and when requiring the connection pool to be cleared, MUST only clear +connections for the `serviceId`. + +#### Post-Handshake Errors + +When the driver is operating in load balanced mode and an application operation receives a state change error, the +driver MUST NOT make any changes to the `TopologyDescription` or the `ServerDescription` of the load balancer (i.e. it +MUST NOT mark the load balancer as `Unknown`). If the error requires the connection pool to be cleared, the driver MUST +only clear connections with the same `serviceId` as the connection which errored. + +### Events + +When in load balancer mode the driver MUST now include the `serviceId` in the - Code:`CommandStartedEvent`, +`CommandSucceededEvent`, and - Code:`CommandFailedEvent`. The driver MAY decide how to expose this information. Drivers +that have a `ConnectionId` object for example, MAY choose to provide a - Code:`serviceId` in that object. The +`serviceId` field is only present when in load balancer mode and connected to a service that is behind a load balancer. + +Additionally the `PoolClearedEvent` MUST also contain a `serviceId` field. + +### Downstream Visible Behavioral Changes + +Services MAY add a command line option or other configuration parameter, that tells the service it is running behind a +load balancer. Services MAY also dynamically determine whether they are behind a load balancer. + +All services which terminate TLS MUST be configured to return a TLS certificate for a hostname which matches the +hostname the client is connecting to. + +All services behind a load balancer that have been started with the aforementioned option MUST add a top level +`serviceId` field to their response to the `hello` command. This field MUST be a BSON `ObjectId` and SHOULD NOT change +while the service is running. When a driver is configured to not be in load balanced mode and the service is configured +behind a load balancer, the service MAY return an error from the driver's `hello` command that the driver is not +configured to use it properly. + +All services that have the behaviour of reaping idle cursors after a specified period of time MAY also close the +connection associated with the cursor when the cursor is reaped. Conversely, those services MAY reap a cursor when the +connection associated with the cursor is closed. + +All services that have the behaviour of reaping idle transactions after a specified period of time MAY also close the +connection associated with the transaction when the transaction is reaped. Conversely, those services must abort a +transaction when the connection associated with the transaction is closed. + +Any applications that connect directly to services and not through the load balancer MUST connect via the regular +service port as they normally would and not the port specified by the `loadBalancerPort` option. The `loadBalanced=true` +URI option MUST be omitted in this case. + +### Q&A + +#### Why use a connection string option instead of a new URI scheme? + +Use of a connection string option would allow the driver to continue to use SRV records that pointed at a load balancer +instead of a replica set without needing to change the URI provided to the `MongoClient`. The SRV records could also +provide the default `loadBalanced=true` in the TXT records. + +#### Why explicitly opt-in to this behaviour instead of letting mongos inform the driver of the load balancer? + +Other versions of this design proposed a scheme in which the application does not have to opt-in to load balanced mode. +Instead, the server would send a special field in `hello` command responses to indicate that it was running behind a +load balancer and the driver would change its behavior accordingly. We opted to take an approach that required code +changes instead because load balancing changes driver behavior in ways that could cause unexpected application errors, +so it made sense to have applications consciously opt-in to this mode. For example, connection pinning creates new +stresses on connection pools because we go from a total of `numMongosServers * maxPoolSize` connections to simply +maxPoolSize. Furthermore, connections get pinned to open cursors and transactions, further straining resource +availability. Due to this change, applications may also need to increase the configured `maxPoolSize` when opting into +this mode. + +#### Why does this specification instruct drivers to not check connections back into the connection pool in some circumstances? + +In the case of a load balancer fronting multiple services, it is possible that a connection to the load balancer could +result in a connection behind the load balancer to a different service. In order to guarantee these operations execute +on the same service they need to be executed on the same socket - not checking a connection back into the pool for the +entire operation guarantees this. + +#### What reason has a client side connection reaper for idle cursors not been put into this specification? + +It was discussed as a potential solution for maxed out connection pools that the drivers could potentially behave +similar to the server and close long running cursors after a specified time period and return their connections to the +pool. Due to the high complexity of that solution it was determined that better error messaging when the connection pool +was maxed out would suffice in order for users to easily debug when the pool ran out of connections and fix their +applications or adjust their pool options accordingly. + +#### Why are we requiring mongos servers to add a new serviceId field in hello responses rather than reusing the existing topologyVersion.processId? + +This option was previously discussed, but we opted to add a new `hello` response field in order to not mix intentions. + +#### Why does this specification not address load balancer restarts or maintenance? + +The Layer 4 load balancers that would be in use for this feature lack the ability that a layer 7 load balancer could +potentially have to be able to understand the MongoDB wire protocol and respond to monitoring requests. + +### Design Rationales + +Services cannot dynamically switch from running behind a load balancer and not running behind a load balancer. Based on +that, this design forces the application to opt-in to this behaviour and make potential changes that require restarts to +their applications. If this were to change, see alternative designs below. + +### Alternative Designs + +#### Service PROXY Detection + +An alternative to the driver using a connection string option to put it into load balancing mode would be for the +service the driver is connected to to inform the driver it is behind a load balancer. A possible solution for this would +be for all services to understand the PROXY protocol such as Data Lake does, and to alter their hello responses to +inform the driver they are behind a load balancer, potentially with the IP address of the load balancer itself. + +The benefit of this solution would be that no changes would be required from the application side, and could also not +require a restart of any application. A single request to the service through the load balancer could automatically +trigger the change in the hello response and cause the driver to switch into load balancing mode pointing at the load +balancer's IP address. Also with this solution it would provide services the ability to record the original IP addresses +of the application that was connecting to it as they are provided the PROXY protocol's header bytes. + +The additional complexity of this alternative on the driver side is that instead of starting in a single mode and +remaining there for the life of the application, the driver would need to deal with additional state changes based on +the results of the server monitors. From a service perspective, every service would need to be updated to understand the +PROXY protocol header bytes prepended to the initial connection and modify their states and hello responses accordingly. +Additionally load balancers would need to have additional configuration as noted in the reference section below, and +only load balancers that support the PROXY protocol would be supported. + +## Changelog + +- 2024-03-06: Migrated from reStructuredText to Markdown. +- 2022-10-05: Remove spec front matter and reformat changelog. +- 2022-01-18: Clarify that `OP_MSG` must be used in load balanced mode. +- 2021-12-22: Clarify that pinned connections in transactions are exclusive. +- 2021-10-14: Note that `loadBalanced=true` conflicts with `srvMaxHosts`. diff --git a/source/load-balancers/load-balancers.rst b/source/load-balancers/load-balancers.rst index f4c78ff790..cb38281d17 100644 --- a/source/load-balancers/load-balancers.rst +++ b/source/load-balancers/load-balancers.rst @@ -1,3 +1,11 @@ + +.. note:: + This specification has been converted to Markdown and renamed to + `load-balancers.md `_. + + Use the link above to access the latest version of the specification as the + current reStructuredText file will no longer be updated. + ===================== Load Balancer Support ===================== diff --git a/source/load-balancers/tests/README.md b/source/load-balancers/tests/README.md new file mode 100644 index 0000000000..45f185caa6 --- /dev/null +++ b/source/load-balancers/tests/README.md @@ -0,0 +1,49 @@ +# Load Balancer Support Tests + +______________________________________________________________________ + +## Introduction + +This document describes how drivers should create load balanced clusters for testing and how tests should be executed +for such clusters. + +## Testing Requirements + +For each server version that supports load balanced clusters, drivers MUST add two Evergreen tasks: one with a sharded +cluster with both authentication and TLS enabled and one with a sharded cluster with authentication and TLS disabled. In +each task, the sharded cluster MUST be configured with two mongos nodes running on localhost ports 27017 and 27018. The +shard and config servers may run on any free ports. Each task MUST also start up two TCP load balancers operating in +round-robin mode: one fronting both mongos servers and one fronting a single mongos. + +### Load Balancer Configuration + +Drivers MUST use the `run-load-balancer.sh` script in `drivers-evergreen-tools` to start the TCP load balancers for +Evergreen tasks. This script MUST be run after the backing sharded cluster has already been started. The script writes +the URIs of the load balancers to a YAML expansions file, which can be read by drivers via the `expansions.update` +Evergreen command. This will store the URIs into the `SINGLE_MONGOS_LB_URI` and `MULTI_MONGOS_LB_URI` environment +variables. + +### Test Runner Configuration + +If the backing sharded cluster is configured with TLS enabled, drivers MUST add the relevant TLS options to both +`SINGLE_MONGOS_LB_URI` and `MULTI_MONGOS_LB_URI` to ensure that test clients can connect to the cluster. Drivers MUST +use the final URI stored in `SINGLE_MONGOS_LB_URI` (with additional TLS options if required) to configure internal +clients for test runners (e.g. the internal MongoClient described by the +[Unified Test Format spec](../../unified-test-format/unified-test-format.md)). + +In addition to modifying load balancer URIs, drivers MUST also mock server support for returning a `serviceId` field in +`hello` or legacy `hello` command responses when running tests against a load-balanced cluster. This can be done by +using the value of `topologyVersion.processId` to set `serviceId`. This MUST be done for all connections established by +the test runner, including those made by any internal clients. + +## Tests + +The YAML and JSON files in this directory contain platform-independent tests written in the +[Unified Test Format](../../unified-test-format/unified-test-format.md). Drivers MUST run the following test suites +against a load balanced cluster: + +1. All test suites written in the Unified Test Format +2. Retryable Reads +3. Retryable Writes +4. Change Streams +5. Initial DNS Seedlist Discovery diff --git a/source/load-balancers/tests/README.rst b/source/load-balancers/tests/README.rst deleted file mode 100644 index 0a3e223f26..0000000000 --- a/source/load-balancers/tests/README.rst +++ /dev/null @@ -1,68 +0,0 @@ -=========================== -Load Balancer Support Tests -=========================== - -.. contents:: - ----- - -Introduction -============ - -This document describes how drivers should create load balanced clusters for -testing and how tests should be executed for such clusters. - -Testing Requirements -==================== - -For each server version that supports load balanced clusters, drivers MUST -add two Evergreen tasks: one with a sharded cluster with both authentication -and TLS enabled and one with a sharded cluster with authentication and TLS -disabled. In each task, the sharded cluster MUST be configured with two -mongos nodes running on localhost ports 27017 and 27018. The shard and config -servers may run on any free ports. Each task MUST also start up two TCP load -balancers operating in round-robin mode: one fronting both mongos servers and -one fronting a single mongos. - -Load Balancer Configuration ---------------------------- - -Drivers MUST use the ``run-load-balancer.sh`` script in -``drivers-evergreen-tools`` to start the TCP load balancers for Evergreen -tasks. This script MUST be run after the backing sharded cluster has already -been started. The script writes the URIs of the load balancers to a YAML -expansions file, which can be read by drivers via the ``expansions.update`` -Evergreen command. This will store the URIs into the ``SINGLE_MONGOS_LB_URI`` -and ``MULTI_MONGOS_LB_URI`` environment variables. - -Test Runner Configuration -------------------------- - -If the backing sharded cluster is configured with TLS enabled, drivers MUST -add the relevant TLS options to both ``SINGLE_MONGOS_LB_URI`` and -``MULTI_MONGOS_LB_URI`` to ensure that test clients can connect to the -cluster. Drivers MUST use the final URI stored in ``SINGLE_MONGOS_LB_URI`` -(with additional TLS options if required) to configure internal clients for -test runners (e.g. the internal MongoClient described by the `Unified Test -Format spec <../../unified-test-format/unified-test-format.md>`__). - -In addition to modifying load balancer URIs, drivers MUST also mock server -support for returning a ``serviceId`` field in ``hello`` or legacy ``hello`` -command responses when running tests against a load-balanced cluster. This -can be done by using the value of ``topologyVersion.processId`` to set -``serviceId``. This MUST be done for all connections established by the test -runner, including those made by any internal clients. - -Tests -====== - -The YAML and JSON files in this directory contain platform-independent tests -written in the `Unified Test Format -<../../unified-test-format/unified-test-format.md>`_. Drivers MUST run the -following test suites against a load balanced cluster: - -#. All test suites written in the Unified Test Format -#. Retryable Reads -#. Retryable Writes -#. Change Streams -#. Initial DNS Seedlist Discovery diff --git a/source/read-write-concern/tests/README.rst b/source/read-write-concern/tests/README.rst index dc07ccba91..4c4dd984f2 100644 --- a/source/read-write-concern/tests/README.rst +++ b/source/read-write-concern/tests/README.rst @@ -57,19 +57,7 @@ Operation These tests check that the default write concern is omitted in operations. -The spec test format is an extension of the `transactions spec legacy test format <../../transactions/tests/legacy-test-format.md>`__ with the following additions: - -- ``writeConcern`` in the ``databaseOptions`` or ``collectionOptions`` may be an empty document to indicate a `server default write concern `_. For example, in libmongoc: - - .. code:: c - - /* Create a default write concern, and set on a collection object. */ - mongoc_write_concern_t *wc = mongoc_write_concern_new (); - mongoc_collection_set_write_concern (collection, wc); - - If the driver has no way to explicitly set a default write concern on a database or collection, ignore the empty ``writeConcern`` document and continue with the test. -- The operations ``createIndex``, ``dropIndex`` are introduced. - +The tests utilize the `Unified Test Format <../../unified-test-format/unified-test-format.md>`__. Use as unit tests ================= diff --git a/source/read-write-concern/tests/operation/default-write-concern-2.6.json b/source/read-write-concern/tests/operation/default-write-concern-2.6.json index c623298cd7..0d8f9c98a1 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-2.6.json +++ b/source/read-write-concern/tests/operation/default-write-concern-2.6.json @@ -1,19 +1,55 @@ { - "data": [ + "description": "default-write-concern-2.6", + "schemaVersion": "1.0", + "runOnRequirements": [ { - "_id": 1, - "x": 11 + "minServerVersion": "2.6" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "default-write-concern-tests", + "databaseOptions": { + "writeConcern": {} + } + } }, { - "_id": 2, - "x": 22 + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll", + "collectionOptions": { + "writeConcern": {} + } + } } ], - "collection_name": "default_write_concern_coll", - "database_name": "default_write_concern_db", - "runOn": [ + "initialData": [ { - "minServerVersion": "2.6" + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] } ], "tests": [ @@ -22,32 +58,36 @@ "operations": [ { "name": "deleteOne", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": {} }, - "result": { + "expectResult": { "deletedCount": 1 } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "delete": "default_write_concern_coll", - "deletes": [ - { - "q": {}, - "limit": 1 + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null + } } - } + ] } ] }, @@ -56,32 +96,36 @@ "operations": [ { "name": "deleteMany", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": {} }, - "result": { + "expectResult": { "deletedCount": 2 } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "delete": "default_write_concern_coll", - "deletes": [ - { - "q": {}, - "limit": 0 + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null + } } - } + ] } ] }, @@ -90,30 +134,24 @@ "operations": [ { "name": "bulkWrite", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "ordered": true, "requests": [ { - "name": "deleteMany", - "arguments": { + "deleteMany": { "filter": {} } }, { - "name": "insertOne", - "arguments": { + "insertOne": { "document": { "_id": 1 } } }, { - "name": "updateOne", - "arguments": { + "updateOne": { "filter": { "_id": 1 }, @@ -125,16 +163,14 @@ } }, { - "name": "insertOne", - "arguments": { + "insertOne": { "document": { "_id": 2 } } }, { - "name": "replaceOne", - "arguments": { + "replaceOne": { "filter": { "_id": 1 }, @@ -144,16 +180,14 @@ } }, { - "name": "insertOne", - "arguments": { + "insertOne": { "document": { "_id": 3 } } }, { - "name": "updateMany", - "arguments": { + "updateMany": { "filter": { "_id": 1 }, @@ -165,8 +199,7 @@ } }, { - "name": "deleteOne", - "arguments": { + "deleteOne": { "filter": { "_id": 3 } @@ -176,148 +209,185 @@ } } ], - "outcome": { - "collection": { - "name": "default_write_concern_coll", - "data": [ + "expectEvents": [ + { + "client": "client0", + "events": [ { - "_id": 1, - "x": 3 + "commandStartedEvent": { + "command": { + "delete": "coll", + "deletes": [ + { + "q": {}, + "limit": 0 + } + ], + "writeConcern": { + "$$exists": false + } + } + } }, { - "_id": 2 - } - ] - } - }, - "expectations": [ - { - "command_started_event": { - "command": { - "delete": "default_write_concern_coll", - "deletes": [ - { - "q": {}, - "limit": 0 + "commandStartedEvent": { + "command": { + "insert": "coll", + "documents": [ + { + "_id": 1 + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "insert": "default_write_concern_coll", - "documents": [ - { - "_id": 1 + } + }, + { + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 1 + }, + "u": { + "$set": { + "x": 1 + } + }, + "upsert": { + "$$unsetOrMatches": false + }, + "multi": { + "$$unsetOrMatches": false + } + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 1 + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "coll", + "documents": [ + { + "_id": 2 } + ], + "writeConcern": { + "$$exists": false } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "insert": "default_write_concern_coll", - "documents": [ - { - "_id": 2 + } + }, + { + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 1 + }, + "u": { + "x": 2 + }, + "upsert": { + "$$unsetOrMatches": false + }, + "multi": { + "$$unsetOrMatches": false + } + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "x": 2 + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "coll", + "documents": [ + { + "_id": 3 + } + ], + "writeConcern": { + "$$exists": false } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "insert": "default_write_concern_coll", - "documents": [ - { - "_id": 3 + } + }, + { + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 1 + }, + "u": { + "$set": { + "x": 3 + } + }, + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 3 + } + }, + { + "commandStartedEvent": { + "command": { + "delete": "coll", + "deletes": [ + { + "q": { + "_id": 3 + }, + "limit": 1 } - }, - "multi": true + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null + } } - } - }, + ] + } + ], + "outcome": [ { - "command_started_event": { - "command": { - "delete": "default_write_concern_coll", - "deletes": [ - { - "q": { - "_id": 3 - }, - "limit": 1 - } - ], - "writeConcern": null + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 3 + }, + { + "_id": 2 } - } + ] } ] }, @@ -326,10 +396,7 @@ "operations": [ { "name": "insertOne", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "document": { "_id": 3 @@ -338,10 +405,7 @@ }, { "name": "insertMany", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "documents": [ { @@ -354,10 +418,51 @@ } } ], - "outcome": { - "collection": { - "name": "default_write_concern_coll", - "data": [ + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll", + "documents": [ + { + "_id": 3 + } + ], + "writeConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "coll", + "documents": [ + { + "_id": 4 + }, + { + "_id": 5 + } + ], + "writeConcern": { + "$$exists": false + } + } + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ { "_id": 1, "x": 11 @@ -377,37 +482,6 @@ } ] } - }, - "expectations": [ - { - "command_started_event": { - "command": { - "insert": "default_write_concern_coll", - "documents": [ - { - "_id": 3 - } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "insert": "default_write_concern_coll", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ], - "writeConcern": null - } - } - } ] }, { @@ -415,10 +489,7 @@ "operations": [ { "name": "updateOne", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 1 @@ -432,10 +503,7 @@ }, { "name": "updateMany", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 2 @@ -449,10 +517,7 @@ }, { "name": "replaceOne", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 2 @@ -463,80 +528,107 @@ } } ], - "outcome": { - "collection": { - "name": "default_write_concern_coll", - "data": [ + "expectEvents": [ + { + "client": "client0", + "events": [ { - "_id": 1, - "x": 1 + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 1 + }, + "u": { + "$set": { + "x": 1 + } + }, + "upsert": { + "$$unsetOrMatches": false + }, + "multi": { + "$$unsetOrMatches": false + } + } + ], + "writeConcern": { + "$$exists": false + } + } + } }, { - "_id": 2, - "x": 3 - } - ] - } - }, - "expectations": [ - { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 1 + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 2 + }, + "u": { + "$set": { + "x": 2 + } + }, + "multi": true, + "upsert": { + "$$unsetOrMatches": false + } } + ], + "writeConcern": { + "$$exists": false } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$set": { - "x": 2 + } + }, + { + "commandStartedEvent": { + "command": { + "update": "coll", + "updates": [ + { + "q": { + "_id": 2 + }, + "u": { + "x": 3 + }, + "upsert": { + "$$unsetOrMatches": false + }, + "multi": { + "$$unsetOrMatches": false + } } - }, - "multi": true + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null + } } - } - }, + ] + } + ], + "outcome": [ { - "command_started_event": { - "command": { - "update": "default_write_concern_coll", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "x": 3 - } - } - ], - "writeConcern": null + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 1 + }, + { + "_id": 2, + "x": 3 } - } + ] } ] } diff --git a/source/read-write-concern/tests/operation/default-write-concern-2.6.yml b/source/read-write-concern/tests/operation/default-write-concern-2.6.yml index 725bcfca12..d18962a7fb 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-2.6.yml +++ b/source/read-write-concern/tests/operation/default-write-concern-2.6.yml @@ -1,215 +1,296 @@ -# Test that setting a default write concern does not add a write concern -# to the command sent over the wire. +# Test that setting a default write concern does not add a write concern to the command sent over the wire. # Test operations that require 2.6+ server. -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} -collection_name: &collection_name default_write_concern_coll -database_name: &database_name default_write_concern_db +description: default-write-concern-2.6 -runOn: - - minServerVersion: "2.6" +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "2.6" + +createEntities: + - + client: + id: &client0 client0 + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name default-write-concern-tests + databaseOptions: + writeConcern: {} + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + collectionOptions: + writeConcern: {} + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } tests: - - description: DeleteOne omits default write concern + - + description: DeleteOne omits default write concern operations: - - name: deleteOne - object: collection - collectionOptions: {writeConcern: {}} + - + name: deleteOne + object: *collection0 arguments: filter: {} - result: + expectResult: deletedCount: 1 - expectations: - - command_started_event: - command: - delete: *collection_name - deletes: - - {q: {}, limit: 1} - writeConcern: null - - description: DeleteMany omits default write concern + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + delete: *collection_name + deletes: [ { q: {}, limit: 1 } ] + writeConcern: { $$exists: false } + - + description: DeleteMany omits default write concern operations: - - name: deleteMany - object: collection - collectionOptions: {writeConcern: {}} + - + name: deleteMany + object: *collection0 arguments: filter: {} - result: + expectResult: deletedCount: 2 - expectations: - - command_started_event: - command: - delete: *collection_name - deletes: [{q: {}, limit: 0}] - writeConcern: null - - description: BulkWrite with all models omits default write concern + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + delete: *collection_name + deletes: [ { q: {}, limit: 0 } ] + writeConcern: { $$exists: false } + - + description: BulkWrite with all models omits default write concern operations: - - name: bulkWrite - object: collection - collectionOptions: {writeConcern: {}} + - + name: bulkWrite + object: *collection0 arguments: ordered: true requests: - - name: deleteMany - arguments: + - + deleteMany: filter: {} - - name: insertOne - arguments: - document: {_id: 1} - - name: updateOne - arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - - name: insertOne - arguments: - document: {_id: 2} - - name: replaceOne - arguments: - filter: {_id: 1} - replacement: {x: 2} - - name: insertOne - arguments: - document: {_id: 3} - - name: updateMany - arguments: - filter: {_id: 1} - update: {$set: {x: 3}} - - name: deleteOne - arguments: - filter: {_id: 3} + - + insertOne: + document: { _id: 1 } + - + updateOne: + filter: { _id: 1 } + update: { $set: { x: 1 } } + - + insertOne: + document: { _id: 2 } + - + replaceOne: + filter: { _id: 1 } + replacement: { x: 2 } + - + insertOne: + document: { _id: 3 } + - + updateMany: + filter: { _id: 1 } + update: { $set: { x: 3 } } + - + deleteOne: + filter: { _id: 3 } + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + delete: *collection_name + deletes: [ { q: {}, limit: 0 } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + insert: *collection_name + documents: [ { _id: 1 } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 1 } + u: { $set: { x: 1 } } + upsert: { $$unsetOrMatches: false } + multi: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + insert: *collection_name + documents: [ { _id: 2 } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 1 } + u: { x: 2 } + upsert: { $$unsetOrMatches: false } + multi: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + insert: *collection_name + documents: [ { _id: 3 } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 1 } + u: { $set: { x: 3 } } + multi: true + upsert: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + delete: *collection_name + deletes: [ { q: { _id: 3 }, limit: 1 } ] + writeConcern: { $$exists: false } outcome: - collection: - name: *collection_name - data: - - {_id: 1, x: 3} - - {_id: 2} - expectations: - - command_started_event: - command: - delete: *collection_name - deletes: [{q: {}, limit: 0}] - writeConcern: null - - command_started_event: - command: - insert: *collection_name - documents: - - {_id: 1} - writeConcern: null - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 1}, u: {$set: {x: 1}}} - writeConcern: null - - command_started_event: - command: - insert: *collection_name - documents: - - {_id: 2} - writeConcern: null - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 1}, u: {x: 2}} - writeConcern: null - - command_started_event: - command: - insert: *collection_name - documents: - - {_id: 3} - writeConcern: null - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 1}, u: {$set: {x: 3}}, multi: true} - writeConcern: null - - command_started_event: - command: - delete: *collection_name - deletes: [{q: {_id: 3}, limit: 1}] - writeConcern: null - - description: 'InsertOne and InsertMany omit default write concern' + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 3 } + - { _id: 2 } + - + description: InsertOne and InsertMany omit default write concern operations: - - name: insertOne - object: collection - collectionOptions: {writeConcern: {}} + - + name: insertOne + object: *collection0 arguments: - document: {_id: 3} - - name: insertMany - object: collection - collectionOptions: {writeConcern: {}} + document: { _id: 3 } + - + name: insertMany + object: *collection0 arguments: documents: - - {_id: 4} - - {_id: 5} + - { _id: 4 } + - { _id: 5 } + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + insert: *collection_name + documents: [ { _id: 3 } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + insert: *collection_name + documents: [ { _id: 4 }, { _id: 5 } ] + writeConcern: { $$exists: false } outcome: - collection: - name: *collection_name - data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3} - - {_id: 4} - - {_id: 5} - expectations: - - command_started_event: - command: - insert: *collection_name - documents: - - {_id: 3} - writeConcern: null - - command_started_event: - command: - insert: *collection_name - documents: - - {_id: 4} - - {_id: 5} - writeConcern: null - - description: 'UpdateOne, UpdateMany, and ReplaceOne omit default write concern' + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3 } + - { _id: 4 } + - { _id: 5 } + - + description: UpdateOne, UpdateMany, and ReplaceOne omit default write concern operations: - - name: updateOne - object: collection - collectionOptions: {writeConcern: {}} + - + name: updateOne + object: *collection0 arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - - name: updateMany - object: collection - collectionOptions: {writeConcern: {}} + filter: { _id: 1 } + update: { $set: { x: 1 } } + - + name: updateMany + object: *collection0 arguments: - filter: {_id: 2} - update: {$set: {x: 2}} - - name: replaceOne - object: collection - collectionOptions: {writeConcern: {}} + filter: { _id: 2 } + update: { $set: { x: 2 } } + - + name: replaceOne + object: *collection0 arguments: - filter: {_id: 2} - replacement: {x: 3} + filter: { _id: 2 } + replacement: { x: 3 } + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 1 } + u: { $set: { x: 1 } } + upsert: { $$unsetOrMatches: false } + multi: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 2 } + u: { $set: { x: 2 } } + multi: true + upsert: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + update: *collection_name + updates: + - + q: { _id: 2 } + u: { x: 3 } + upsert: { $$unsetOrMatches: false } + multi: { $$unsetOrMatches: false } + writeConcern: { $$exists: false } outcome: - collection: - name: *collection_name - data: - - {_id: 1, x: 1} - - {_id: 2, x: 3} - expectations: - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 1}, u: {$set: {x: 1}}} - writeConcern: null - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 2}, u: {$set: {x: 2}}, multi: true} - writeConcern: null - - command_started_event: - command: - update: *collection_name - updates: - - {q: {_id: 2}, u: {x: 3}} - writeConcern: null \ No newline at end of file + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 1 } + - { _id: 2, x: 3 } diff --git a/source/read-write-concern/tests/operation/default-write-concern-3.2.json b/source/read-write-concern/tests/operation/default-write-concern-3.2.json index 04dd231f04..166a184916 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-3.2.json +++ b/source/read-write-concern/tests/operation/default-write-concern-3.2.json @@ -1,19 +1,55 @@ { - "data": [ + "description": "default-write-concern-3.2", + "schemaVersion": "1.0", + "runOnRequirements": [ { - "_id": 1, - "x": 11 + "minServerVersion": "3.2" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } }, { - "_id": 2, - "x": 22 + "database": { + "id": "database0", + "client": "client0", + "databaseName": "default-write-concern-tests", + "databaseOptions": { + "writeConcern": {} + } + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll", + "collectionOptions": { + "writeConcern": {} + } + } } ], - "collection_name": "default_write_concern_coll", - "database_name": "default_write_concern_db", - "runOn": [ + "initialData": [ { - "minServerVersion": "3.2" + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] } ], "tests": [ @@ -22,10 +58,7 @@ "operations": [ { "name": "findOneAndUpdate", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 1 @@ -39,10 +72,7 @@ }, { "name": "findOneAndReplace", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 2 @@ -54,10 +84,7 @@ }, { "name": "findOneAndDelete", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "filter": { "_id": 2 @@ -65,59 +92,71 @@ } } ], - "outcome": { - "collection": { - "name": "default_write_concern_coll", - "data": [ + "expectEvents": [ + { + "client": "client0", + "events": [ { - "_id": 1, - "x": 1 + "commandStartedEvent": { + "command": { + "findAndModify": "coll", + "query": { + "_id": 1 + }, + "update": { + "$set": { + "x": 1 + } + }, + "writeConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll", + "query": { + "_id": 2 + }, + "update": { + "x": 2 + }, + "writeConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "findAndModify": "coll", + "query": { + "_id": 2 + }, + "remove": true, + "writeConcern": { + "$$exists": false + } + } + } } ] } - }, - "expectations": [ - { - "command_started_event": { - "command": { - "findAndModify": "default_write_concern_coll", - "query": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - }, - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default_write_concern_coll", - "query": { - "_id": 2 - }, - "update": { - "x": 2 - }, - "writeConcern": null - } - } - }, + ], + "outcome": [ { - "command_started_event": { - "command": { - "findAndModify": "default_write_concern_coll", - "query": { - "_id": 2 - }, - "remove": true, - "writeConcern": null + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 1 } - } + ] } ] } diff --git a/source/read-write-concern/tests/operation/default-write-concern-3.2.yml b/source/read-write-concern/tests/operation/default-write-concern-3.2.yml index dccb7e0d07..eb109cb9fb 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-3.2.yml +++ b/source/read-write-concern/tests/operation/default-write-concern-3.2.yml @@ -1,58 +1,91 @@ -# Test that setting a default write concern does not add a write concern -# to the command sent over the wire. -# Test operations that require 3.2+ server, where findAndModify started -# to accept a write concern. +# Test that setting a default write concern does not add a write concern to the command sent over the wire. +# Test operations that require 3.2+ server, where findAndModify started to accept a write concern. -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} -collection_name: &collection_name default_write_concern_coll -database_name: &database_name default_write_concern_db +description: default-write-concern-3.2 -runOn: - - minServerVersion: "3.2" +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "3.2" + +createEntities: + - + client: + id: &client0 client0 + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name default-write-concern-tests + databaseOptions: + writeConcern: {} + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + collectionOptions: + writeConcern: {} + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } tests: - - description: 'findAndModify operations omit default write concern' + - + description: findAndModify operations omit default write concern operations: - - name: findOneAndUpdate - object: collection - collectionOptions: {writeConcern: {}} + - + name: findOneAndUpdate + object: *collection0 arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - - name: findOneAndReplace - object: collection - collectionOptions: {writeConcern: {}} + filter: { _id: 1 } + update: { $set: { x: 1 } } + - + name: findOneAndReplace + object: *collection0 arguments: - filter: {_id: 2} - replacement: {x: 2} - - name: findOneAndDelete - object: collection - collectionOptions: {writeConcern: {}} + filter: { _id: 2 } + replacement: { x: 2 } + - + name: findOneAndDelete + object: *collection0 arguments: - filter: {_id: 2} + filter: { _id: 2 } + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + findAndModify: *collection_name + query: { _id: 1 } + update: { $set: { x: 1 } } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + findAndModify: *collection_name + query: { _id: 2 } + update: { x: 2 } + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + findAndModify: *collection_name + query: { _id: 2 } + remove: true + writeConcern: { $$exists: false } outcome: - collection: - name: *collection_name - data: - - {_id: 1, x: 1} - expectations: - - command_started_event: - command: - findAndModify: *collection_name - query: {_id: 1} - update: {$set: {x: 1}} - writeConcern: null - - command_started_event: - command: - findAndModify: *collection_name - query: {_id: 2} - update: {x: 2} - writeConcern: null - - command_started_event: - command: - findAndModify: *collection_name - query: {_id: 2} - remove: true - writeConcern: null \ No newline at end of file + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 1 } diff --git a/source/read-write-concern/tests/operation/default-write-concern-3.4.json b/source/read-write-concern/tests/operation/default-write-concern-3.4.json index 6519f6f089..e18cdfc0c4 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-3.4.json +++ b/source/read-write-concern/tests/operation/default-write-concern-3.4.json @@ -1,30 +1,68 @@ { - "data": [ + "description": "default-write-concern-3.4", + "schemaVersion": "1.4", + "runOnRequirements": [ { - "_id": 1, - "x": 11 + "minServerVersion": "3.4" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "default-write-concern-tests", + "databaseOptions": { + "writeConcern": {} + } + } }, { - "_id": 2, - "x": 22 + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll", + "collectionOptions": { + "writeConcern": {} + } + } } ], - "collection_name": "default_write_concern_coll", - "database_name": "default_write_concern_db", - "runOn": [ + "initialData": [ { - "minServerVersion": "3.4" + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] } ], "tests": [ { "description": "Aggregate with $out omits default write concern", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "name": "aggregate", "arguments": { "pipeline": [ @@ -42,37 +80,45 @@ } } ], - "outcome": { - "collection": { - "name": "other_collection_name", - "data": [ + "expectEvents": [ + { + "client": "client0", + "events": [ { - "_id": 2, - "x": 22 + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$out": "other_collection_name" + } + ], + "writeConcern": { + "$$exists": false + } + } + } } ] } - }, - "expectations": [ + ], + "outcome": [ { - "command_started_event": { - "command": { - "aggregate": "default_write_concern_coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_collection_name" - } - ], - "writeConcern": null + "collectionName": "other_collection_name", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 2, + "x": 22 } - } + ] } ] }, @@ -80,39 +126,43 @@ "description": "RunCommand with a write command omits default write concern (runCommand should never inherit write concern)", "operations": [ { - "object": "database", - "databaseOptions": { - "writeConcern": {} - }, + "object": "database0", "name": "runCommand", - "command_name": "delete", "arguments": { "command": { - "delete": "default_write_concern_coll", + "delete": "coll", "deletes": [ { "q": {}, "limit": 1 } ] - } + }, + "commandName": "delete" } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "delete": "default_write_concern_coll", - "deletes": [ - { - "q": {}, - "limit": 1 + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "delete": "coll", + "deletes": [ + { + "q": {}, + "limit": 1 + } + ], + "writeConcern": { + "$$exists": false + } } - ], - "writeConcern": null + } } - } + ] } ] }, @@ -120,10 +170,7 @@ "description": "CreateIndex and dropIndex omits default write concern", "operations": [ { - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "name": "createIndex", "arguments": { "keys": { @@ -132,53 +179,61 @@ } }, { - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "name": "dropIndex", "arguments": { "name": "x_1" } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "createIndexes": "default_write_concern_coll", - "indexes": [ - { - "name": "x_1", - "key": { - "x": 1 + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "createIndexes": "coll", + "indexes": [ + { + "name": "x_1", + "key": { + "x": 1 + } + } + ], + "writeConcern": { + "$$exists": false } } - ], - "writeConcern": null - } - } - }, - { - "command_started_event": { - "command": { - "dropIndexes": "default_write_concern_coll", - "index": "x_1", - "writeConcern": null + } + }, + { + "commandStartedEvent": { + "command": { + "dropIndexes": "coll", + "index": "x_1", + "writeConcern": { + "$$exists": false + } + } + } } - } + ] } ] }, { "description": "MapReduce omits default write concern", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "name": "mapReduce", - "object": "collection", - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "arguments": { "map": { "$code": "function inc() { return emit(0, this.x + 1) }" @@ -192,23 +247,30 @@ } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "mapReduce": "default_write_concern_coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - }, - "writeConcern": null + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "mapReduce": "coll", + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + }, + "writeConcern": { + "$$exists": false + } + } + } } - } + ] } ] } diff --git a/source/read-write-concern/tests/operation/default-write-concern-3.4.yml b/source/read-write-concern/tests/operation/default-write-concern-3.4.yml index c7b586cadc..7596208868 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-3.4.yml +++ b/source/read-write-concern/tests/operation/default-write-concern-3.4.yml @@ -1,95 +1,144 @@ -# Test that setting a default write concern does not add a write concern -# to the command sent over the wire. -# Test operations that require 3.4+ server, where all commands started -# to accept a write concern. +# Test that setting a default write concern does not add a write concern to the command sent over the wire. +# Test operations that require 3.4+ server, where all commands started to accept a write concern. -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} -collection_name: &collection_name default_write_concern_coll -database_name: &database_name default_write_concern_db +description: default-write-concern-3.4 -runOn: - - minServerVersion: "3.4" +schemaVersion: "1.4" + +runOnRequirements: + - minServerVersion: "3.4" + +createEntities: + - + client: + id: &client0 client0 + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name default-write-concern-tests + databaseOptions: + writeConcern: {} + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + collectionOptions: + writeConcern: {} + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } tests: - - description: Aggregate with $out omits default write concern + - + description: Aggregate with $out omits default write concern + # Serverless does not support $out stage + runOnRequirements: + - serverless: forbid operations: - - object: collection - collectionOptions: {writeConcern: {}} + - + object: *collection0 name: aggregate arguments: pipeline: &out_pipeline - - $match: {_id: {$gt: 1}} + - $match: { _id: { $gt: 1 } } - $out: &other_collection_name "other_collection_name" + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: *out_pipeline + writeConcern: { $$exists: false } outcome: - collection: - name: *other_collection_name - data: - - {_id: 2, x: 22} - expectations: - - command_started_event: - command: - aggregate: *collection_name - pipeline: *out_pipeline - writeConcern: null - - description: RunCommand with a write command omits default write concern (runCommand should never inherit write concern) + - + collectionName: *other_collection_name + databaseName: *database_name + documents: + - { _id: 2, x: 22 } + - + description: RunCommand with a write command omits default write concern (runCommand should never inherit write concern) operations: - - object: database - databaseOptions: {writeConcern: {}} + - + object: *database0 name: runCommand - command_name: delete arguments: command: delete: *collection_name - deletes: - - {q: {}, limit: 1} - expectations: - - command_started_event: - command: - delete: *collection_name - deletes: - - {q: {}, limit: 1} - writeConcern: null - - description: CreateIndex and dropIndex omits default write concern + deletes: [ { q: {}, limit: 1 } ] + commandName: delete + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + delete: *collection_name + deletes: [ { q: {}, limit: 1 } ] + writeConcern: { $$exists: false } + - + description: CreateIndex and dropIndex omits default write concern operations: - - object: collection - collectionOptions: {writeConcern: {}} + - + object: *collection0 name: createIndex arguments: - keys: {x: 1} - - object: collection - collectionOptions: {writeConcern: {}} + keys: { x: 1 } + - + object: *collection0 name: dropIndex arguments: name: x_1 - expectations: - - command_started_event: - command: - createIndexes: *collection_name - indexes: - - name: x_1 - key: {x: 1} - writeConcern: null - - command_started_event: - command: - dropIndexes: *collection_name - index: x_1 - writeConcern: null - - description: MapReduce omits default write concern + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + createIndexes: *collection_name + indexes: [ { name: "x_1", key: { x: 1 } } ] + writeConcern: { $$exists: false } + - + commandStartedEvent: + command: + dropIndexes: *collection_name + index: x_1 + writeConcern: { $$exists: false } + - + description: MapReduce omits default write concern + # Serverless does not support mapReduce operation + runOnRequirements: + - serverless: forbid operations: - - name: mapReduce - object: collection - collectionOptions: {writeConcern: {}} + - + name: mapReduce + object: *collection0 arguments: - map: { $code: 'function inc() { return emit(0, this.x + 1) }' } - reduce: { $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' } + map: { $code: "function inc() { return emit(0, this.x + 1) }" } + reduce: { $code: "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" } out: { inline: 1 } - expectations: - - command_started_event: - command: - mapReduce: *collection_name - map: { $code: 'function inc() { return emit(0, this.x + 1) }' } - reduce: { $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' } - out: { inline: 1 } - writeConcern: null \ No newline at end of file + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + mapReduce: *collection_name + map: { $code: "function inc() { return emit(0, this.x + 1) }" } + reduce: { $code: "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" } + out: { inline: 1 } + writeConcern: { $$exists: false } diff --git a/source/read-write-concern/tests/operation/default-write-concern-4.2.json b/source/read-write-concern/tests/operation/default-write-concern-4.2.json index fef192d1a3..e8bb78d91d 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-4.2.json +++ b/source/read-write-concern/tests/operation/default-write-concern-4.2.json @@ -1,19 +1,55 @@ { - "data": [ + "description": "default-write-concern-4.2", + "schemaVersion": "1.0", + "runOnRequirements": [ { - "_id": 1, - "x": 11 + "minServerVersion": "4.2" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } }, { - "_id": 2, - "x": 22 + "database": { + "id": "database0", + "client": "client0", + "databaseName": "default-write-concern-tests", + "databaseOptions": { + "writeConcern": {} + } + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll", + "collectionOptions": { + "writeConcern": {} + } + } } ], - "collection_name": "default_write_concern_coll", - "database_name": "default_write_concern_db", - "runOn": [ + "initialData": [ { - "minServerVersion": "4.2" + "collectionName": "coll", + "databaseName": "default-write-concern-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] } ], "tests": [ @@ -21,13 +57,7 @@ "description": "Aggregate with $merge omits default write concern", "operations": [ { - "object": "collection", - "databaseOptions": { - "writeConcern": {} - }, - "collectionOptions": { - "writeConcern": {} - }, + "object": "collection0", "name": "aggregate", "arguments": { "pipeline": [ @@ -47,41 +77,49 @@ } } ], - "expectations": [ + "expectEvents": [ { - "command_started_event": { - "command": { - "aggregate": "default_write_concern_coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$merge": { + "into": "other_collection_name" + } } - } - }, - { - "$merge": { - "into": "other_collection_name" + ], + "writeConcern": { + "$$exists": false } } - ], - "writeConcern": null + } } - } + ] } ], - "outcome": { - "collection": { - "name": "other_collection_name", - "data": [ + "outcome": [ + { + "collectionName": "other_collection_name", + "databaseName": "default-write-concern-tests", + "documents": [ { "_id": 2, "x": 22 } ] } - } + ] } ] } diff --git a/source/read-write-concern/tests/operation/default-write-concern-4.2.yml b/source/read-write-concern/tests/operation/default-write-concern-4.2.yml index 6039b55814..3ce742e655 100644 --- a/source/read-write-concern/tests/operation/default-write-concern-4.2.yml +++ b/source/read-write-concern/tests/operation/default-write-concern-4.2.yml @@ -1,36 +1,66 @@ -# Test that setting a default write concern does not add a write concern -# to the command sent over the wire. +# Test that setting a default write concern does not add a write concern to the command sent over the wire. # Test operations that require 4.2+ server. -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} -collection_name: &collection_name default_write_concern_coll -database_name: &database_name default_write_concern_db +description: default-write-concern-4.2 -runOn: - - minServerVersion: "4.2" +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.2" + +createEntities: + - + client: + id: &client0 client0 + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name default-write-concern-tests + databaseOptions: + writeConcern: {} + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + collectionOptions: + writeConcern: {} + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } tests: - - description: Aggregate with $merge omits default write concern + - + description: Aggregate with $merge omits default write concern operations: - - object: collection - databaseOptions: {writeConcern: {}} - collectionOptions: {writeConcern: {}} + - + object: *collection0 name: aggregate arguments: pipeline: &merge_pipeline - - $match: {_id: {$gt: 1}} - - $merge: {into: &other_collection_name "other_collection_name" } - expectations: - - command_started_event: - command: - aggregate: *collection_name - pipeline: *merge_pipeline - # "null" fields will be checked for non-existence - writeConcern: null + - $match: { _id: { $gt: 1 } } + - $merge: { into: &other_collection_name "other_collection_name" } + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: *merge_pipeline + writeConcern: { $$exists: false } outcome: - collection: - name: *other_collection_name - data: - - {_id: 2, x: 22} \ No newline at end of file + - + collectionName: *other_collection_name + databaseName: *database_name + documents: + - { _id: 2, x: 22 } diff --git a/source/retryable-reads/tests/README.rst b/source/retryable-reads/tests/README.rst index cd8f43597e..ec41911497 100644 --- a/source/retryable-reads/tests/README.rst +++ b/source/retryable-reads/tests/README.rst @@ -9,192 +9,18 @@ Retryable Reads Tests Introduction ============ -The YAML and JSON files in the ``legacy`` and ``unified`` sub-directories are platform-independent tests -that drivers can use to prove their conformance to the Retryable Reads spec. Tests in the -``unified`` directory are written using the `Unified Test Format <../../unified-test-format/unified-test-format.md>`_. -Tests in the ``legacy`` directory are written using the format described below. +The YAML and JSON files in this directory are platform-independent tests meant +to exercise a driver's implementation of retryable reads. These tests utilize +the [Unified Test Format](../../unified-test-format/unified-test-format.md). -Prose tests, which are not easily expressed in YAML, are also presented +Several prose tests, which are not easily expressed in YAML, are also presented in this file. Those tests will need to be manually implemented by each driver. -Tests will require a MongoClient created with options defined in the tests. -Integration tests will require a running MongoDB cluster with server versions -4.0 or later. +Prose Tests +=========== -N.B. The spec specifies 3.6 as the minimum server version: however, -``failCommand`` is not supported on 3.6, so for now, testing requires MongoDB -4.0. Once `DRIVERS-560`_ is resolved, we will attempt to adapt its live failure -integration tests to test Retryable Reads on MongoDB 3.6. - -.. _DRIVERS-560: https://jira.mongodb.org/browse/DRIVERS-560 - -Server Fail Point -================= - -See: `Server Fail Point`_ in the Transactions spec test suite. - -.. _Server Fail Point: ../../transactions/tests#server-fail-point - -Disabling Fail Point after Test Execution ------------------------------------------ - -After each test that configures a fail point, drivers should disable the -``failCommand`` fail point to avoid spurious failures in -subsequent tests. The fail point may be disabled like so:: - - db.runCommand({ - configureFailPoint: "failCommand", - mode: "off" - }); - -Network Error Tests -=================== - -Network error tests are expressed in YAML and should be run against a standalone, -shard cluster, or single-node replica set. - - -Test Format ------------ - -Each YAML file has the following keys: - -- ``runOn`` (optional): An array of server version and/or topology requirements - for which the tests can be run. If the test environment satisfies one or more - of these requirements, the tests may be executed; otherwise, this file should - be skipped. If this field is omitted, the tests can be assumed to have no - particular requirements and should be executed. Each element will have some or - all of the following fields: - - - ``minServerVersion`` (optional): The minimum server version (inclusive) - required to successfully run the tests. If this field is omitted, it should - be assumed that there is no lower bound on the required server version. - - - ``maxServerVersion`` (optional): The maximum server version (inclusive) - against which the tests can be run successfully. If this field is omitted, - it should be assumed that there is no upper bound on the required server - version. - - - ``topology`` (optional): An array of server topologies against which the - tests can be run successfully. Valid topologies are "single", - "replicaset", "sharded", and "load-balanced". If this field is omitted, - the default is all topologies (i.e. ``["single", "replicaset", "sharded", - "load-balanced"]``). - - - ``serverless``: (optional): Whether or not the test should be run on Atlas - Serverless instances. Valid values are "require", "forbid", and "allow". If - "require", the test MUST only be run on Atlas Serverless instances. If - "forbid", the test MUST NOT be run on Atlas Serverless instances. If omitted - or "allow", this option has no effect. - - The test runner MUST be informed whether or not Atlas Serverless is being - used in order to determine if this requirement is met (e.g. through an - environment variable or configuration option). - - Note: the Atlas Serverless proxy imitates mongos, so the test runner is not - capable of determining if Atlas Serverless is in use by issuing commands - such as ``buildInfo`` or ``hello``. Furthermore, connections to Atlas - Serverless use a load balancer, so the topology will appear as - "load-balanced". - -- ``database_name`` and ``collection_name``: Optional. The database and - collection to use for testing. - -- ``bucket_name``: Optional. The GridFS bucket name to use for testing. - -- ``data``: The data that should exist in the collection(s) under test before - each test run. This will typically be an array of documents to be inserted - into the collection under test (i.e. ``collection_name``); however, this field - may also be an object mapping collection names to arrays of documents to be - inserted into the specified collection. - -- ``tests``: An array of tests that are to be run independently of each other. - Each test will have some or all of the following fields: - - - ``description``: The name of the test. - - - ``clientOptions``: Optional, parameters to pass to MongoClient(). - - - ``useMultipleMongoses`` (optional): If ``true``, and the topology type is - ``Sharded``, the MongoClient for this test should be initialized with multiple - mongos seed addresses. If ``false`` or omitted, only a single mongos address - should be specified. - - If ``true``, the topology type is ``LoadBalanced``, and Atlas Serverless is - not being used, the MongoClient for this test should be initialized with the - URI of the load balancer fronting multiple servers. If ``false`` or omitted, - the MongoClient for this test should be initialized with the URI of the load - balancer fronting a single server. - - ``useMultipleMongoses`` only affects ``Sharded`` and ``LoadBalanced`` - topologies (excluding Atlas Serverless). - - - ``skipReason``: Optional, string describing why this test should be skipped. - - - ``failPoint``: Optional, a server fail point to enable, expressed as the - configureFailPoint command to run on the admin database. - - - ``operations``: An array of documents describing an operation to be - executed. Each document has the following fields: - - - ``name``: The name of the operation on ``object``. - - - ``object``: The name of the object to perform the operation on. Can be - "database", "collection", "client", or "gridfsbucket." - - - ``arguments``: Optional, the names and values of arguments. - - - ``result``: Optional. The return value from the operation, if any. This - field may be a scalar (e.g. in the case of a count), a single document, or - an array of documents in the case of a multi-document read. - - - ``error``: Optional. If ``true``, the test should expect an error or - exception. - - - ``expectations``: Optional list of command-started events. - -GridFS Tests ------------- - -GridFS tests are denoted by when the YAML file contains ``bucket_name``. -The ``data`` field will also be an object, which maps collection names -(e.g. ``fs.files``) to an array of documents that should be inserted into -the specified collection. - -``fs.files`` and ``fs.chunks`` should be created in the database -specified by ``database_name``. This could be done via inserts or by -creating GridFSBuckets—using the GridFS ``bucketName`` (see -`GridFSBucket spec`_) specified by ``bucket_name`` field in the YAML -file—and calling ``upload_from_stream_with_id`` with the appropriate -data. - -``Download`` tests should be tested against ``GridFS.download_to_stream``. -``DownloadByName`` tests should be tested against -``GridFS.download_to_stream_by_name``. - - -.. _GridFSBucket spec: https://github.com/mongodb/specifications/blob/master../../gridfs/gridfs-spec.md#configurable-gridfsbucket-class - - -Speeding Up Tests ------------------ - -Drivers can greatly reduce the execution time of tests by setting `heartbeatFrequencyMS`_ -and `minHeartbeatFrequencyMS`_ (internally) to a small value (e.g. 5ms), below what -is normally permitted in the SDAM spec. If a test specifies an explicit value for -heartbeatFrequencyMS (e.g. client or URI options), drivers MUST use that value. - -.. _minHeartbeatFrequencyMS: ../../server-discovery-and-monitoring/server-discovery-and-monitoring.rst#minheartbeatfrequencyms -.. _heartbeatFrequencyMS: ../../server-discovery-and-monitoring/server-discovery-and-monitoring.rst#heartbeatfrequencyms - -Optional Enumeration Commands -============================= - -A driver only needs to test the optional enumeration commands it has chosen to -implement (e.g. ``Database.listCollectionNames()``). - -PoolClearedError Retryability Test -================================== +1. PoolClearedError Retryability Test +------------------------------------- This test will be used to ensure drivers properly retry after encountering PoolClearedErrors. It MUST be implemented by any driver that implements the CMAP specification. @@ -232,8 +58,8 @@ This test requires MongoDB 4.2.9+ for ``blockConnection`` support in the failpoi 9. Disable the failpoint. -Retrying Reads in a Sharded Cluster -=================================== +2. Retrying Reads in a Sharded Cluster +-------------------------------------- These tests will be used to ensure drivers properly retry reads on a different mongos. @@ -244,8 +70,8 @@ different mongos due to normal SDAM behavior of randomized suitable server selection". Verify relevant code paths are correctly executed by the tests using external means such as a logging, debugger, code coverage tool, etc. -Retryable Reads Are Retried on a Different mongos When One is Available ------------------------------------------------------------------------ +2.1 Retryable Reads Are Retried on a Different mongos When One is Available +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This test MUST be executed against a sharded cluster that has at least two mongos instances, supports ``retryReads=true``, and has enabled the @@ -278,8 +104,8 @@ mongos instances, supports ``retryReads=true``, and has enabled the 7. Disable the fail point on both ``s0`` and ``s1``. -Retryable Reads Are Retried on the Same mongos When No Others are Available ---------------------------------------------------------------------------- +2.2 Retryable Reads Are Retried on the Same mongos When No Others are Available +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This test MUST be executed against a sharded cluster that supports ``retryReads=true`` and has enabled the ``configureFailPoint`` command @@ -316,10 +142,12 @@ This test MUST be executed against a sharded cluster that supports Changelog ========= +:2024-03-06: Convert legacy retryable reads tests to unified format. + :2024-02-21: Update mongos redirection prose tests to workaround SDAM behavior preventing execution of deprioritization code paths. -:2023-08-26 Add prose tests for retrying in a sharded cluster. +:2023-08-26: Add prose tests for retrying in a sharded cluster. :2022-04-22: Clarifications to ``serverless`` and ``useMultipleMongoses``. diff --git a/source/retryable-reads/tests/legacy/aggregate-merge.json b/source/retryable-reads/tests/legacy/aggregate-merge.json deleted file mode 100644 index b401d741ba..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate-merge.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.11" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Aggregate with $merge does not retry", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "object": "collection", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "output-collection" - } - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "output-collection" - } - } - ] - }, - "command_name": "aggregate", - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/aggregate-merge.yml b/source/retryable-reads/tests/legacy/aggregate-merge.yml deleted file mode 100644 index f9913348f4..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate-merge.yml +++ /dev/null @@ -1,39 +0,0 @@ -runOn: - - - minServerVersion: "4.1.11" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "Aggregate with $merge does not retry" - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [aggregate] - closeConnection: true - operations: - - - object: collection - name: aggregate - arguments: - pipeline: &pipeline - - $match: {_id: {$gt: 1}} - - $sort: {x: 1} - - $merge: { into: "output-collection" } - error: true - expectations: - - - command_started_event: - command: - aggregate: *collection_name - pipeline: *pipeline - command_name: aggregate - database_name: *database_name diff --git a/source/retryable-reads/tests/legacy/aggregate-serverErrors.json b/source/retryable-reads/tests/legacy/aggregate-serverErrors.json deleted file mode 100644 index 1155f808dc..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate-serverErrors.json +++ /dev/null @@ -1,1208 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Aggregate succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/aggregate-serverErrors.yml b/source/retryable-reads/tests/legacy/aggregate-serverErrors.yml deleted file mode 100644 index bf9fc01892..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate-serverErrors.yml +++ /dev/null @@ -1,157 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "Aggregate succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [aggregate], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: aggregate - object: collection - arguments: - pipeline: - - $match: - _id: {$gt: 1} - - $sort: {x: 1} - result: - - {_id: 2, x: 22} - - {_id: 3, x: 33} - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - pipeline: [{$match: {_id: {$gt: 1}}}, {$sort: {x: 1}}] - database_name: *database_name - - *retryable_command_started_event - - - description: "Aggregate succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [aggregate], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/aggregate.json b/source/retryable-reads/tests/legacy/aggregate.json deleted file mode 100644 index f23d5c6793..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate.json +++ /dev/null @@ -1,406 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Aggregate succeeds on first attempt", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "result": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Aggregate with $out does not retry", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "output-collection" - } - ] - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "output-collection" - } - ] - }, - "command_name": "aggregate", - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/aggregate.yml b/source/retryable-reads/tests/legacy/aggregate.yml deleted file mode 100644 index de9c0d7069..0000000000 --- a/source/retryable-reads/tests/legacy/aggregate.yml +++ /dev/null @@ -1,87 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "Aggregate succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: aggregate - object: collection - arguments: - pipeline: - - $match: {_id: {$gt: 1}} - - $sort: {x: 1} - result: - - {_id: 2, x: 22} - - {_id: 3, x: 33} - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - pipeline: [{$match: {_id: {$gt: 1}}}, {$sort: {x: 1}}] - database_name: *database_name - - - description: "Aggregate succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [aggregate] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "Aggregate fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Aggregate with $out does not retry" - failPoint: *failCommand_failPoint - operations: - - <<: *retryable_operation_fails - arguments: - pipeline: - - $match: {_id: {$gt: 1}} - - $sort: {x: 1} - - $out: "output-collection" - expectations: - - command_started_event: - command: - aggregate: *collection_name - pipeline: [{$match: {_id: {$gt: 1}}}, {$sort: {x: 1}}, {$out: 'output-collection'}] - command_name: aggregate - database_name: *database_name diff --git a/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.json b/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.json deleted file mode 100644 index 73dbfee916..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.json +++ /dev/null @@ -1,740 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "client.watch succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.yml b/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.yml deleted file mode 100644 index a1f1069643..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-client.watch-serverErrors.yml +++ /dev/null @@ -1,150 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "client.watch succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [aggregate], errorCode: 11600 } - operations: - - &retryable_operation - name: watch - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: 1 - cursor: {} - pipeline: [ { $changeStream: { allChangesForCluster: true } } ] - database_name: admin - - *retryable_command_started_event - - - description: "client.watch succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [aggregate], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/changeStreams-client.watch.json b/source/retryable-reads/tests/legacy/changeStreams-client.watch.json deleted file mode 100644 index 30a53037ad..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-client.watch.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - } - ], - "tests": [ - { - "description": "client.watch succeeds on first attempt", - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - }, - { - "description": "client.watch fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "database_name": "admin" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-client.watch.yml b/source/retryable-reads/tests/legacy/changeStreams-client.watch.yml deleted file mode 100644 index ea7f7e069a..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-client.watch.yml +++ /dev/null @@ -1,62 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - -tests: - - - description: "client.watch succeeds on first attempt" - operations: - - &retryable_operation - name: watch - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: 1 - cursor: {} - pipeline: [ { $changeStream: { "allChangesForCluster": true } } ] - database_name: admin - - - description: "client.watch succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [aggregate] - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "client.watch fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "client.watch fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.json b/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.json deleted file mode 100644 index 77b3af04f4..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.json +++ /dev/null @@ -1,690 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "db.coll.watch succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.yml b/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.yml deleted file mode 100644 index 4e4bb4a1b7..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch-serverErrors.yml +++ /dev/null @@ -1,150 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "db.coll.watch succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [aggregate], errorCode: 11600 } - operations: - - &retryable_operation - name: watch - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - cursor: {} - pipeline: [ { $changeStream: { } } ] - database_name: *database_name - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [aggregate], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.json b/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.json deleted file mode 100644 index 27f6105a4b..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - } - ], - "tests": [ - { - "description": "db.coll.watch succeeds on first attempt", - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.coll.watch fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.yml b/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.yml deleted file mode 100644 index c8334b1a99..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.coll.watch.yml +++ /dev/null @@ -1,66 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - -tests: - - - description: "db.coll.watch succeeds on first attempt" - operations: - - &retryable_operation - name: watch - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - cursor: {} - pipeline: [ { $changeStream: { } } ] - database_name: *database_name - - - description: "db.coll.watch succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - aggregate - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.coll.watch fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "db.coll.watch fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.json b/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.json deleted file mode 100644 index 7a87534508..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.json +++ /dev/null @@ -1,690 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "db.watch succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "watch", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.yml b/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.yml deleted file mode 100644 index a527935bae..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.watch-serverErrors.yml +++ /dev/null @@ -1,154 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "db.watch succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [aggregate], errorCode: 11600 } - operations: - - &retryable_operation - name: watch - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: 1 - cursor: {} - pipeline: [ { $changeStream: { } } ] - database_name: *database_name - - *retryable_command_started_event - - - description: "db.watch succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [aggregate], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - - - diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.watch.json b/source/retryable-reads/tests/legacy/changeStreams-db.watch.json deleted file mode 100644 index e6b0b9b781..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.watch.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - } - ], - "tests": [ - { - "description": "db.watch succeeds on first attempt", - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "db.watch fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "watch", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/changeStreams-db.watch.yml b/source/retryable-reads/tests/legacy/changeStreams-db.watch.yml deleted file mode 100644 index e2ceacbb66..0000000000 --- a/source/retryable-reads/tests/legacy/changeStreams-db.watch.yml +++ /dev/null @@ -1,62 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - -tests: - - - description: "db.watch succeeds on first attempt" - operations: - - &retryable_operation - name: watch - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: 1 - cursor: {} - pipeline: [ { $changeStream: { } } ] - database_name: *database_name - - - description: "db.watch succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [aggregate] - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "db.watch fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "db.watch fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/count-serverErrors.json b/source/retryable-reads/tests/legacy/count-serverErrors.json deleted file mode 100644 index 36a0c17cab..0000000000 --- a/source/retryable-reads/tests/legacy/count-serverErrors.json +++ /dev/null @@ -1,586 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "Count succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/count-serverErrors.yml b/source/retryable-reads/tests/legacy/count-serverErrors.yml deleted file mode 100644 index 48ceaea68b..0000000000 --- a/source/retryable-reads/tests/legacy/count-serverErrors.yml +++ /dev/null @@ -1,150 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "Count succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [count], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: count - object: collection - arguments: { filter: { } } - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - count: *collection_name - database_name: *database_name - - *retryable_command_started_event - - - description: "Count succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [count], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/count.json b/source/retryable-reads/tests/legacy/count.json deleted file mode 100644 index 139a545131..0000000000 --- a/source/retryable-reads/tests/legacy/count.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "Count succeeds on first attempt", - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Count fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/count.yml b/source/retryable-reads/tests/legacy/count.yml deleted file mode 100644 index c9c3936b6b..0000000000 --- a/source/retryable-reads/tests/legacy/count.yml +++ /dev/null @@ -1,64 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "Count succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: count - object: collection - arguments: { filter: { } } - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - count: *collection_name - database_name: *database_name - - - description: "Count succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [count] - closeConnection: true - - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Count fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "Count fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/countDocuments-serverErrors.json b/source/retryable-reads/tests/legacy/countDocuments-serverErrors.json deleted file mode 100644 index 782ea5e4f1..0000000000 --- a/source/retryable-reads/tests/legacy/countDocuments-serverErrors.json +++ /dev/null @@ -1,911 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "CountDocuments succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/countDocuments-serverErrors.yml b/source/retryable-reads/tests/legacy/countDocuments-serverErrors.yml deleted file mode 100644 index 4ffb9a05b5..0000000000 --- a/source/retryable-reads/tests/legacy/countDocuments-serverErrors.yml +++ /dev/null @@ -1,150 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "CountDocuments succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [aggregate], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: countDocuments - object: collection - arguments: { filter: { } } - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - pipeline: [{'$match': {}}, {'$group': {'_id': 1, 'n': {'$sum': 1}}}] - database_name: *database_name - - *retryable_command_started_event - - - description: "CountDocuments succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [aggregate], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [aggregate], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/countDocuments.json b/source/retryable-reads/tests/legacy/countDocuments.json deleted file mode 100644 index 57a64e45b7..0000000000 --- a/source/retryable-reads/tests/legacy/countDocuments.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "CountDocuments succeeds on first attempt", - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "CountDocuments fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/countDocuments.yml b/source/retryable-reads/tests/legacy/countDocuments.yml deleted file mode 100644 index 9e2565129c..0000000000 --- a/source/retryable-reads/tests/legacy/countDocuments.yml +++ /dev/null @@ -1,64 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "CountDocuments succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: countDocuments - object: collection - arguments: { filter: { } } - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - aggregate: *collection_name - pipeline: [{'$match': {}}, {'$group': {'_id': 1, 'n': {'$sum': 1}}}] - database_name: *database_name - - - description: "CountDocuments succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [aggregate] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "CountDocuments fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "CountDocuments fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/distinct-serverErrors.json b/source/retryable-reads/tests/legacy/distinct-serverErrors.json deleted file mode 100644 index d7c6018a62..0000000000 --- a/source/retryable-reads/tests/legacy/distinct-serverErrors.json +++ /dev/null @@ -1,838 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Distinct succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/distinct-serverErrors.yml b/source/retryable-reads/tests/legacy/distinct-serverErrors.yml deleted file mode 100644 index d4bc118ff6..0000000000 --- a/source/retryable-reads/tests/legacy/distinct-serverErrors.yml +++ /dev/null @@ -1,156 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "Distinct succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [distinct], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: distinct - object: collection - arguments: { fieldName: "x", filter: { _id: { $gt: 1 } } } - result: - - 22 - - 33 - expectations: - - &retryable_command_started_event - command_started_event: - command: - distinct: *collection_name - key: "x" - query: - _id: {$gt: 1} - database_name: *database_name - - *retryable_command_started_event - - - description: "Distinct succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [distinct], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [distinct], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/distinct.json b/source/retryable-reads/tests/legacy/distinct.json deleted file mode 100644 index 1fd415da81..0000000000 --- a/source/retryable-reads/tests/legacy/distinct.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "tests": [ - { - "description": "Distinct succeeds on first attempt", - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "result": [ - 22, - 33 - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Distinct fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/distinct.yml b/source/retryable-reads/tests/legacy/distinct.yml deleted file mode 100644 index 8ca2ac8315..0000000000 --- a/source/retryable-reads/tests/legacy/distinct.yml +++ /dev/null @@ -1,71 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - -tests: - - - description: "Distinct succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: distinct - object: collection - arguments: { fieldName: "x", filter: { _id: { $gt: 1 } } } - result: - - 22 - - 33 - expectations: - - &retryable_command_started_event - command_started_event: - command: - distinct: *collection_name - key: "x" - query: - _id: {$gt: 1} - database_name: *database_name - - - description: "Distinct succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [distinct] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Distinct fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - - description: "Distinct fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.json b/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.json deleted file mode 100644 index 6bb128f5f3..0000000000 --- a/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.json +++ /dev/null @@ -1,546 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "EstimatedDocumentCount succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.yml b/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.yml deleted file mode 100644 index aefb89ca69..0000000000 --- a/source/retryable-reads/tests/legacy/estimatedDocumentCount-serverErrors.yml +++ /dev/null @@ -1,148 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "EstimatedDocumentCount succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [count], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: estimatedDocumentCount - object: collection - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - count: *collection_name - database_name: *database_name - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [count], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [count], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/estimatedDocumentCount.json b/source/retryable-reads/tests/legacy/estimatedDocumentCount.json deleted file mode 100644 index 8dfa15a2cd..0000000000 --- a/source/retryable-reads/tests/legacy/estimatedDocumentCount.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ], - "tests": [ - { - "description": "EstimatedDocumentCount succeeds on first attempt", - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "EstimatedDocumentCount fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "count": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/estimatedDocumentCount.yml b/source/retryable-reads/tests/legacy/estimatedDocumentCount.yml deleted file mode 100644 index de03e483bb..0000000000 --- a/source/retryable-reads/tests/legacy/estimatedDocumentCount.yml +++ /dev/null @@ -1,62 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: "EstimatedDocumentCount succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: estimatedDocumentCount - object: collection - result: 2 - expectations: - - &retryable_command_started_event - command_started_event: - command: - count: *collection_name - database_name: *database_name - - - description: "EstimatedDocumentCount succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [count] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "EstimatedDocumentCount fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "EstimatedDocumentCount fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/find-serverErrors.json b/source/retryable-reads/tests/legacy/find-serverErrors.json deleted file mode 100644 index f6b96c6dcb..0000000000 --- a/source/retryable-reads/tests/legacy/find-serverErrors.json +++ /dev/null @@ -1,962 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ], - "tests": [ - { - "description": "Find succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/find-serverErrors.yml b/source/retryable-reads/tests/legacy/find-serverErrors.yml deleted file mode 100644 index e122f3e2c8..0000000000 --- a/source/retryable-reads/tests/legacy/find-serverErrors.yml +++ /dev/null @@ -1,160 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - - {_id: 5, x: 55} - -tests: - - - description: "Find succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [find], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: find - object: collection - arguments: { filter: {}, sort: { _id: 1 }, limit: 4 } - result: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: *collection_name - filter: {} - sort: {_id: 1} - limit: 4 - database_name: *database_name - - *retryable_command_started_event - - - description: "Find succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [find], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/find.json b/source/retryable-reads/tests/legacy/find.json deleted file mode 100644 index 00d419c0da..0000000000 --- a/source/retryable-reads/tests/legacy/find.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ], - "tests": [ - { - "description": "Find succeeds on first attempt", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds on second attempt with explicit clientOptions", - "clientOptions": { - "retryReads": true - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "result": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Find fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/find.yml b/source/retryable-reads/tests/legacy/find.yml deleted file mode 100644 index b685c07b6a..0000000000 --- a/source/retryable-reads/tests/legacy/find.yml +++ /dev/null @@ -1,86 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - - {_id: 5, x: 55} - -tests: - - - description: "Find succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: find - object: collection - arguments: - filter: {} - sort: {_id: 1} - limit: 4 - result: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: *collection_name - filter: {} - sort: {_id: 1} - limit: 4 - database_name: *database_name - - - description: "Find succeeds on second attempt with explicit clientOptions" - clientOptions: - retryReads: true - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [find] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find succeeds on second attempt" - failPoint: *failCommand_failPoint - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Find fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "Find fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/findOne-serverErrors.json b/source/retryable-reads/tests/legacy/findOne-serverErrors.json deleted file mode 100644 index d039ef247e..0000000000 --- a/source/retryable-reads/tests/legacy/findOne-serverErrors.json +++ /dev/null @@ -1,732 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ], - "tests": [ - { - "description": "FindOne succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/findOne-serverErrors.yml b/source/retryable-reads/tests/legacy/findOne-serverErrors.yml deleted file mode 100644 index b6e7657408..0000000000 --- a/source/retryable-reads/tests/legacy/findOne-serverErrors.yml +++ /dev/null @@ -1,154 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - - {_id: 5, x: 55} - -tests: - - - description: "FindOne succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [find], errorCode: 11600 } - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: findOne - object: collection - arguments: - filter: {_id: 1} - result: {_id: 1, x: 11} - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: *collection_name - filter: {_id: 1} - database_name: *database_name - - *retryable_command_started_event - - - description: "FindOne succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 11602 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13435 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13436 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 189 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 91 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 7 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 6 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 89 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 9001 } - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [find], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/findOne.json b/source/retryable-reads/tests/legacy/findOne.json deleted file mode 100644 index b9deb73d2a..0000000000 --- a/source/retryable-reads/tests/legacy/findOne.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ], - "tests": [ - { - "description": "FindOne succeeds on first attempt", - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "x": 11 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "FindOne fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/findOne.yml b/source/retryable-reads/tests/legacy/findOne.yml deleted file mode 100644 index 911314e98e..0000000000 --- a/source/retryable-reads/tests/legacy/findOne.yml +++ /dev/null @@ -1,68 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 11} - - {_id: 2, x: 22} - - {_id: 3, x: 33} - - {_id: 4, x: 44} - - {_id: 5, x: 55} - -tests: - - - description: "FindOne succeeds on first attempt" - operations: - - &retryable_operation_succeeds - <<: &retryable_operation - name: findOne - object: collection - arguments: {filter: {_id: 1 }} - result: {_id: 1, x: 11} - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: *collection_name - filter: {_id: 1} - database_name: *database_name - - - description: "FindOne succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [find] - closeConnection: true - operations: [*retryable_operation_succeeds] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "FindOne fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "FindOne fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.json b/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.json deleted file mode 100644 index cec3a5016a..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.json +++ /dev/null @@ -1,925 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "bucket_name": "fs", - "data": { - "fs.files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ], - "fs.chunks": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - }, - "tests": [ - { - "description": "Download succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.yml b/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.yml deleted file mode 100644 index e120c162fd..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-download-serverErrors.yml +++ /dev/null @@ -1,173 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -bucket_name: "fs" - -data: - fs.files: - - - _id: { $oid : "000000000000000000000001" } - length: 1 - chunkSize: 4 - uploadDate: { $date : "1970-01-01T00:00:00.000Z" } - filename: abc - metadata: {} - fs.chunks: - - { _id: { $oid: "000000000000000000000002" }, files_id: { $oid: "000000000000000000000001" }, n: 0, data: { $binary: { base64: "EQ==", subType: "00" } } } - -tests: - - - description: "Download succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [find], errorCode: 11600 } - operations: - - &retryable_operation - name: download - object: gridfsbucket - arguments: { id: { "$oid" : "000000000000000000000001" } } - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: fs.files - filter: { _id: {$oid : "000000000000000000000001" }} - database_name: *database_name - - *retryable_command_started_event - - &find_chunks_command_started_event - command_started_event: - command: - find: fs.chunks - filter: { files_id: {$oid : "000000000000000000000001" }} - sort: { n: 1 } - database_name: *database_name - - - description: "Download succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [find], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "Download fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/gridfs-download.json b/source/retryable-reads/tests/legacy/gridfs-download.json deleted file mode 100644 index 4d0d5a17e4..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-download.json +++ /dev/null @@ -1,270 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "bucket_name": "fs", - "data": { - "fs.files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ], - "fs.chunks": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - }, - "tests": [ - { - "description": "Download succeeds on first attempt", - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "Download fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download", - "object": "gridfsbucket", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/gridfs-download.yml b/source/retryable-reads/tests/legacy/gridfs-download.yml deleted file mode 100644 index a71c719d9a..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-download.yml +++ /dev/null @@ -1,79 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -bucket_name: "fs" - -data: - fs.files: - - - _id: { $oid : "000000000000000000000001" } - length: 1 - chunkSize: 4 - uploadDate: { $date : "1970-01-01T00:00:00.000Z" } - filename: abc - metadata: {} - fs.chunks: - - { _id: { $oid: "000000000000000000000002" }, files_id: { $oid: "000000000000000000000001" }, n: 0, data: { $binary: { base64: "EQ==", subType: "00" } } } - -tests: - - - description: "Download succeeds on first attempt" - operations: - - &retryable_operation - name: download - object: gridfsbucket - arguments: { id: { "$oid" : "000000000000000000000001" } } - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: fs.files - filter: { _id: {$oid : "000000000000000000000001" }} - database_name: *database_name - - &find_chunks_command_started_event - command_started_event: - command: - find: fs.chunks - filter: { files_id: {$oid : "000000000000000000000001" }} - sort: { n: 1 } - database_name: *database_name - - - description: "Download succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [find] - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "Download fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "Download fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.json b/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.json deleted file mode 100644 index a64230d38a..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.json +++ /dev/null @@ -1,849 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "bucket_name": "fs", - "data": { - "fs.files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ], - "fs.chunks": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - }, - "tests": [ - { - "description": "DownloadByName succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.yml b/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.yml deleted file mode 100644 index 704492135e..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-downloadByName-serverErrors.yml +++ /dev/null @@ -1,174 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -bucket_name: "fs" - -data: - fs.files: - - - _id: { $oid : "000000000000000000000001" } - length: 1 - chunkSize: 4 - uploadDate: { $date : "1970-01-01T00:00:00.000Z" } - filename: abc - metadata: {} - fs.chunks: - - { _id: { $oid: "000000000000000000000002" }, files_id: { $oid: "000000000000000000000001" }, n: 0, data: { $binary: { base64: "EQ==", subType: "00" } } } - -tests: - - - description: "DownloadByName succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [find], errorCode: 11600 } - operations: - - &retryable_operation - name: download_by_name - object: gridfsbucket - arguments: - filename: abc - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: fs.files - filter: { filename : "abc" } - database_name: *database_name - - *retryable_command_started_event - - &find_chunks_command_started_event - command_started_event: - command: - find: fs.chunks - filter: { files_id: { $oid : "000000000000000000000001" }} - sort: { n: 1 } - database_name: *database_name - - - description: "DownloadByName succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [find], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "DownloadByName fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [find], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/gridfs-downloadByName.json b/source/retryable-reads/tests/legacy/gridfs-downloadByName.json deleted file mode 100644 index 48f2168cfc..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-downloadByName.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "bucket_name": "fs", - "data": { - "fs.files": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ], - "fs.chunks": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - }, - "tests": [ - { - "description": "DownloadByName succeeds on first attempt", - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.chunks", - "filter": { - "files_id": { - "$oid": "000000000000000000000001" - } - }, - "sort": { - "n": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "DownloadByName fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "download_by_name", - "object": "gridfsbucket", - "arguments": { - "filename": "abc" - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/gridfs-downloadByName.yml b/source/retryable-reads/tests/legacy/gridfs-downloadByName.yml deleted file mode 100644 index e5586954f0..0000000000 --- a/source/retryable-reads/tests/legacy/gridfs-downloadByName.yml +++ /dev/null @@ -1,79 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -bucket_name: "fs" - -data: - fs.files: - - - _id: { $oid : "000000000000000000000001" } - length: 1 - chunkSize: 4 - uploadDate: { $date : "1970-01-01T00:00:00.000Z" } - filename: abc - metadata: {} - fs.chunks: - - { _id: { $oid: "000000000000000000000002" }, files_id: { $oid: "000000000000000000000001" }, n: 0, data: { $binary: { base64: "EQ==", subType: "00" } } } - -tests: - - - description: "DownloadByName succeeds on first attempt" - operations: - - &retryable_operation - name: download_by_name - object: gridfsbucket - arguments: { filename: "abc" } - expectations: - - &retryable_command_started_event - command_started_event: - command: - find: fs.files - filter: { filename : "abc" } - database_name: *database_name - - &find_chunks_command_started_event - command_started_event: - command: - find: fs.chunks - filter: { files_id: {$oid : "000000000000000000000001"} } - sort: { n: 1 } - database_name: *database_name - - - description: "DownloadByName succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [find] - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - *find_chunks_command_started_event - - - description: "DownloadByName fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "DownloadByName fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.json b/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.json deleted file mode 100644 index bbdce625ad..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollectionNames succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.yml b/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.yml deleted file mode 100644 index b99bddf827..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionNames-serverErrors.yml +++ /dev/null @@ -1,143 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollectionNames succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listCollections], errorCode: 11600 } - operations: - - &retryable_operation - name: listCollectionNames - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listCollections], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/listCollectionNames.json b/source/retryable-reads/tests/legacy/listCollectionNames.json deleted file mode 100644 index 73d96a3cf7..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionNames.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollectionNames succeeds on first attempt", - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionNames fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionNames", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollectionNames.yml b/source/retryable-reads/tests/legacy/listCollectionNames.yml deleted file mode 100644 index 434adfbdd1..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionNames.yml +++ /dev/null @@ -1,59 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollectionNames succeeds on first attempt" - operations: - - &retryable_operation - name: listCollectionNames - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - - description: "ListCollectionNames succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listCollections - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionNames fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListCollectionNames fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.json b/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.json deleted file mode 100644 index ab469dfe30..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollectionObjects succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.yml b/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.yml deleted file mode 100644 index b2ff9ee830..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionObjects-serverErrors.yml +++ /dev/null @@ -1,148 +0,0 @@ -# listCollectionObjects returns an array of MongoCollection objects. -# Not all drivers support this functionality. For more details, see: -# https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst#returning-a-list-of-collection-objects - -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollectionObjects succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listCollections], errorCode: 11600 } - operations: - - &retryable_operation - name: listCollectionObjects - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listCollections], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listCollectionObjects.json b/source/retryable-reads/tests/legacy/listCollectionObjects.json deleted file mode 100644 index 1fb0f18437..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionObjects.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollectionObjects succeeds on first attempt", - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollectionObjects fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollectionObjects", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollectionObjects.yml b/source/retryable-reads/tests/legacy/listCollectionObjects.yml deleted file mode 100644 index 4315694850..0000000000 --- a/source/retryable-reads/tests/legacy/listCollectionObjects.yml +++ /dev/null @@ -1,63 +0,0 @@ -# listCollectionObjects returns an array of MongoCollection objects. -# Not all drivers support this functionality. For more details, see: -# https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst#returning-a-list-of-collection-objects - -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollectionObjects succeeds on first attempt" - operations: - - &retryable_operation - name: listCollectionObjects - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - - description: "ListCollectionObjects succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listCollections - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollectionObjects fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListCollectionObjects fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listCollections-serverErrors.json b/source/retryable-reads/tests/legacy/listCollections-serverErrors.json deleted file mode 100644 index def9ac4595..0000000000 --- a/source/retryable-reads/tests/legacy/listCollections-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollections succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollections-serverErrors.yml b/source/retryable-reads/tests/legacy/listCollections-serverErrors.yml deleted file mode 100644 index 94a9495e52..0000000000 --- a/source/retryable-reads/tests/legacy/listCollections-serverErrors.yml +++ /dev/null @@ -1,143 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollections succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listCollections], errorCode: 11600 } - operations: - - &retryable_operation - name: listCollections - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - *retryable_command_started_event - - - description: "ListCollections succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listCollections], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listCollections], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/listCollections.json b/source/retryable-reads/tests/legacy/listCollections.json deleted file mode 100644 index 2427883621..0000000000 --- a/source/retryable-reads/tests/legacy/listCollections.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListCollections succeeds on first attempt", - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - }, - { - "description": "ListCollections fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listCollections", - "object": "database", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listCollections.yml b/source/retryable-reads/tests/legacy/listCollections.yml deleted file mode 100644 index 378ff924f4..0000000000 --- a/source/retryable-reads/tests/legacy/listCollections.yml +++ /dev/null @@ -1,59 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListCollections succeeds on first attempt" - operations: - - &retryable_operation - name: listCollections - object: database - expectations: - - &retryable_command_started_event - command_started_event: - command: - listCollections: 1 - - - description: "ListCollections succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listCollections - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListCollections fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListCollections fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.json b/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.json deleted file mode 100644 index 1dd8e4415a..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabaseNames succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.yml b/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.yml deleted file mode 100644 index ca6b150944..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseNames-serverErrors.yml +++ /dev/null @@ -1,143 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabaseNames succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listDatabases], errorCode: 11600 } - operations: - - &retryable_operation - name: listDatabaseNames - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/listDatabaseNames.json b/source/retryable-reads/tests/legacy/listDatabaseNames.json deleted file mode 100644 index b431f57016..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseNames.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabaseNames succeeds on first attempt", - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseNames fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseNames", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabaseNames.yml b/source/retryable-reads/tests/legacy/listDatabaseNames.yml deleted file mode 100644 index 13e01a48ea..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseNames.yml +++ /dev/null @@ -1,59 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabaseNames succeeds on first attempt" - operations: - - &retryable_operation - name: listDatabaseNames - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - - description: "ListDatabaseNames succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listDatabases - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseNames fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListDatabaseNames fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.json b/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.json deleted file mode 100644 index bc497bb088..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabaseObjects succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.yml b/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.yml deleted file mode 100644 index adc8214a3b..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseObjects-serverErrors.yml +++ /dev/null @@ -1,148 +0,0 @@ -# listDatabaseObjects returns an array of MongoDatabase objects. -# Not all drivers support this functionality. For more details, see: -# https://github.com/mongodb/specifications/blob/master/source/enumerate-databases.rst#enumerating-mongodatabase-objects - -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabaseObjects succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listDatabases], errorCode: 11600 } - operations: - - &retryable_operation - name: listDatabaseObjects - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listDatabaseObjects.json b/source/retryable-reads/tests/legacy/listDatabaseObjects.json deleted file mode 100644 index 267fe921ca..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseObjects.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabaseObjects succeeds on first attempt", - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabaseObjects fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabaseObjects", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabaseObjects.yml b/source/retryable-reads/tests/legacy/listDatabaseObjects.yml deleted file mode 100644 index 9ed2c216a5..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabaseObjects.yml +++ /dev/null @@ -1,63 +0,0 @@ -# listDatabaseObjects returns an array of MongoDatabase objects. -# Not all drivers support this functionality. For more details, see: -# https://github.com/mongodb/specifications/blob/master/source/enumerate-databases.rst#enumerating-mongodatabase-objects - -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabaseObjects succeeds on first attempt" - operations: - - &retryable_operation - name: listDatabaseObjects - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - - description: "ListDatabaseObjects succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listDatabases - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabaseObjects fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListDatabaseObjects fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listDatabases-serverErrors.json b/source/retryable-reads/tests/legacy/listDatabases-serverErrors.json deleted file mode 100644 index ed7bcbc398..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabases-serverErrors.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabases succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabases-serverErrors.yml b/source/retryable-reads/tests/legacy/listDatabases-serverErrors.yml deleted file mode 100644 index ac904701de..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabases-serverErrors.yml +++ /dev/null @@ -1,144 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabases succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listDatabases], errorCode: 11600 } - operations: - - &retryable_operation - name: listDatabases - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - *retryable_command_started_event - - - description: "ListDatabases succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listDatabases], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listDatabases.json b/source/retryable-reads/tests/legacy/listDatabases.json deleted file mode 100644 index 69ef9788f8..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabases.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListDatabases succeeds on first attempt", - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - }, - { - "description": "ListDatabases fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listDatabases", - "object": "client", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - }, - { - "command_started_event": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listDatabases.yml b/source/retryable-reads/tests/legacy/listDatabases.yml deleted file mode 100644 index 3eaed913ad..0000000000 --- a/source/retryable-reads/tests/legacy/listDatabases.yml +++ /dev/null @@ -1,59 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListDatabases succeeds on first attempt" - operations: - - &retryable_operation - name: listDatabases - object: client - expectations: - - &retryable_command_started_event - command_started_event: - command: - listDatabases: 1 - - - description: "ListDatabases succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listDatabases - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListDatabases fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListDatabases fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.json b/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.json deleted file mode 100644 index 2d3265ec85..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.json +++ /dev/null @@ -1,527 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListIndexNames succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.yml b/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.yml deleted file mode 100644 index 6fb7e30cbf..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexNames-serverErrors.yml +++ /dev/null @@ -1,144 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListIndexNames succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listIndexes], errorCode: 11600 } - operations: - - &retryable_operation - name: listIndexNames - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - listIndexes: *collection_name - database_name: *database_name - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event diff --git a/source/retryable-reads/tests/legacy/listIndexNames.json b/source/retryable-reads/tests/legacy/listIndexNames.json deleted file mode 100644 index fbdb420f8a..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexNames.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListIndexNames succeeds on first attempt", - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexNames fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexNames", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listIndexNames.yml b/source/retryable-reads/tests/legacy/listIndexNames.yml deleted file mode 100644 index 3a73b51e15..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexNames.yml +++ /dev/null @@ -1,60 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListIndexNames succeeds on first attempt" - operations: - - &retryable_operation - name: listIndexNames - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - listIndexes: *collection_name - database_name: *database_name - - - description: "ListIndexNames succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listIndexes - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexNames fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListIndexNames fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listIndexes-serverErrors.json b/source/retryable-reads/tests/legacy/listIndexes-serverErrors.json deleted file mode 100644 index 25c5b0e448..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexes-serverErrors.json +++ /dev/null @@ -1,527 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListIndexes succeeds after InterruptedAtShutdown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11600 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after InterruptedDueToReplStateChange", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11602 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after NotWritablePrimary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after NotPrimaryNoSecondaryOk", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13435 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after NotPrimaryOrSecondary", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13436 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after PrimarySteppedDown", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 189 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after ShutdownInProgress", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 91 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after HostNotFound", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after HostUnreachable", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 6 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after NetworkTimeout", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 89 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds after SocketException", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 9001 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes fails after two NotWritablePrimary errors", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes fails after NotWritablePrimary when retryReads is false", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listIndexes-serverErrors.yml b/source/retryable-reads/tests/legacy/listIndexes-serverErrors.yml deleted file mode 100644 index 23f2768e9a..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexes-serverErrors.yml +++ /dev/null @@ -1,145 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListIndexes succeeds after InterruptedAtShutdown" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: { failCommands: [listIndexes], errorCode: 11600 } - operations: - - &retryable_operation - name: listIndexes - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - listIndexes: *collection_name - database_name: *database_name - - *retryable_command_started_event - - - description: "ListIndexes succeeds after InterruptedDueToReplStateChange" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 11602 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after NotWritablePrimary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after NotPrimaryNoSecondaryOk" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 13435 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after NotPrimaryOrSecondary" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 13436 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after PrimarySteppedDown" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 189 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after ShutdownInProgress" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 91 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after HostNotFound" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 7 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after HostUnreachable" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 6 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after NetworkTimeout" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 89 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes succeeds after SocketException" - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 9001 } - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes fails after two NotWritablePrimary errors" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes fails after NotWritablePrimary when retryReads is false" - clientOptions: - retryReads: false - failPoint: - <<: *failCommand_failPoint - data: { failCommands: [listIndexes], errorCode: 10107 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/listIndexes.json b/source/retryable-reads/tests/legacy/listIndexes.json deleted file mode 100644 index 5cb620ae45..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexes.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ] - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [], - "tests": [ - { - "description": "ListIndexes succeeds on first attempt", - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes succeeds on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes fails on first attempt", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "ListIndexes fails on second attempt", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "listIndexes", - "object": "collection", - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - }, - { - "command_started_event": { - "command": { - "listIndexes": "coll" - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/listIndexes.yml b/source/retryable-reads/tests/legacy/listIndexes.yml deleted file mode 100644 index 84ba7242a3..0000000000 --- a/source/retryable-reads/tests/legacy/listIndexes.yml +++ /dev/null @@ -1,60 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: [] - -tests: - - - description: "ListIndexes succeeds on first attempt" - operations: - - &retryable_operation - name: listIndexes - object: collection - expectations: - - &retryable_command_started_event - command_started_event: - command: - listIndexes: *collection_name - database_name: *database_name - - - description: "ListIndexes succeeds on second attempt" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: - - listIndexes - closeConnection: true - operations: [*retryable_operation] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - - - description: "ListIndexes fails on first attempt" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: - - &retryable_operation_fails - <<: *retryable_operation - error: true - expectations: - - *retryable_command_started_event - - - description: "ListIndexes fails on second attempt" - failPoint: - <<: *failCommand_failPoint - mode: { times: 2 } - operations: [*retryable_operation_fails] - expectations: - - *retryable_command_started_event - - *retryable_command_started_event - diff --git a/source/retryable-reads/tests/legacy/mapReduce.json b/source/retryable-reads/tests/legacy/mapReduce.json deleted file mode 100644 index 9327a23052..0000000000 --- a/source/retryable-reads/tests/legacy/mapReduce.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.0", - "topology": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topology": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "retryable-reads-tests", - "collection_name": "coll", - "data": [ - { - "_id": 1, - "x": 0 - }, - { - "_id": 2, - "x": 1 - }, - { - "_id": 3, - "x": 2 - } - ], - "tests": [ - { - "description": "MapReduce succeeds with retry on", - "operations": [ - { - "name": "mapReduce", - "object": "collection", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "result": [ - { - "_id": 0, - "value": 6 - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "MapReduce fails with retry on", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "mapReduce" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "mapReduce", - "object": "collection", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - }, - { - "description": "MapReduce fails with retry off", - "clientOptions": { - "retryReads": false - }, - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "mapReduce" - ], - "closeConnection": true - } - }, - "operations": [ - { - "name": "mapReduce", - "object": "collection", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "error": true - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "database_name": "retryable-reads-tests" - } - } - ] - } - ] -} diff --git a/source/retryable-reads/tests/legacy/mapReduce.yml b/source/retryable-reads/tests/legacy/mapReduce.yml deleted file mode 100644 index def8b37485..0000000000 --- a/source/retryable-reads/tests/legacy/mapReduce.yml +++ /dev/null @@ -1,62 +0,0 @@ -runOn: - - - minServerVersion: "4.0" - topology: ["single", "replicaset"] - - - minServerVersion: "4.1.7" - topology: ["sharded", "load-balanced"] - # serverless proxy does not support mapReduce operation - serverless: "forbid" - -database_name: &database_name "retryable-reads-tests" -collection_name: &collection_name "coll" - -data: - - {_id: 1, x: 0} - - {_id: 2, x: 1} - - {_id: 3, x: 2} - -tests: - - - description: "MapReduce succeeds with retry on" - operations: - - &operation_succeeds - <<: &operation - name: mapReduce - object: collection - arguments: - map: { $code: "function inc() { return emit(0, this.x + 1) }" } - reduce: { $code: "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" } - out: { inline: 1 } - result: [ { "_id" : 0, "value" : 6 } ] - expectations: - - &command_started_event - command_started_event: - command: - mapReduce: *collection_name - map: { $code: "function inc() { return emit(0, this.x + 1) }" } - reduce: { $code: "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" } - out: { inline: 1 } - database_name: *database_name - - - description: "MapReduce fails with retry on" - failPoint: &failCommand_failPoint - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [mapReduce] - closeConnection: true - operations: - - &operation_fails - <<: *operation - error: true - expectations: - - *command_started_event - - - description: "MapReduce fails with retry off" - clientOptions: - retryReads: false - failPoint: *failCommand_failPoint - operations: [*operation_fails] - expectations: - - *command_started_event diff --git a/source/retryable-reads/tests/unified/aggregate-merge.json b/source/retryable-reads/tests/unified/aggregate-merge.json new file mode 100644 index 0000000000..96bbd0fc38 --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate-merge.json @@ -0,0 +1,143 @@ +{ + "description": "aggregate-merge", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.1.11" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Aggregate with $merge does not retry", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + }, + { + "$merge": { + "into": "output-collection" + } + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + }, + { + "$merge": { + "into": "output-collection" + } + } + ] + }, + "commandName": "aggregate", + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/aggregate-merge.yml b/source/retryable-reads/tests/unified/aggregate-merge.yml new file mode 100644 index 0000000000..0add82b667 --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate-merge.yml @@ -0,0 +1,86 @@ +description: aggregate-merge + +schemaVersion: '1.0' + +runOnRequirements: + - + minServerVersion: 4.1.11 + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + +tests: + - + description: 'Aggregate with $merge does not retry' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - + object: *collection0 + name: aggregate + arguments: + pipeline: &pipeline + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + - + $merge: + into: output-collection + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: *pipeline + commandName: aggregate + databaseName: *database_name diff --git a/source/retryable-reads/tests/unified/aggregate-serverErrors.json b/source/retryable-reads/tests/unified/aggregate-serverErrors.json new file mode 100644 index 0000000000..d39835a5d3 --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate-serverErrors.json @@ -0,0 +1,1430 @@ +{ + "description": "aggregate-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Aggregate succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/aggregate-serverErrors.yml b/source/retryable-reads/tests/unified/aggregate-serverErrors.yml new file mode 100644 index 0000000000..66a3f2cbbb --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate-serverErrors.yml @@ -0,0 +1,411 @@ +description: aggregate-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + +tests: + - + description: 'Aggregate succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: aggregate + arguments: + pipeline: + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + expectResult: + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: + - + $match: + _id: { $gt: 1 } + - + $sort: + x: 1 + databaseName: *database_name + - *retryable_command_started_event + - + description: 'Aggregate succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: aggregate + arguments: + pipeline: + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/aggregate.json b/source/retryable-reads/tests/unified/aggregate.json new file mode 100644 index 0000000000..2b504c8d49 --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate.json @@ -0,0 +1,527 @@ +{ + "description": "aggregate", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Aggregate succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Aggregate with $out does not retry", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "aggregate", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + }, + { + "$out": "output-collection" + } + ] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + }, + { + "$out": "output-collection" + } + ] + }, + "commandName": "aggregate", + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/aggregate.yml b/source/retryable-reads/tests/unified/aggregate.yml new file mode 100644 index 0000000000..fa25d1f992 --- /dev/null +++ b/source/retryable-reads/tests/unified/aggregate.yml @@ -0,0 +1,227 @@ +description: aggregate + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + +tests: + - + description: 'Aggregate succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: aggregate + arguments: + pipeline: + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + expectResult: + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: + - + $match: + _id: { $gt: 1 } + - + $sort: + x: 1 + databaseName: *database_name + - + description: 'Aggregate succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: aggregate + arguments: + pipeline: + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'Aggregate fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Aggregate with $out does not retry' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: *failCommand_failPoint + - + object: *collection0 + name: aggregate + arguments: + pipeline: + - + $match: + _id: + $gt: 1 + - + $sort: + x: 1 + - + $out: output-collection + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: + - + $match: + _id: { $gt: 1 } + - + $sort: + x: 1 + - + $out: output-collection + commandName: aggregate + databaseName: *database_name diff --git a/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.json b/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.json new file mode 100644 index 0000000000..47375974d2 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.json @@ -0,0 +1,959 @@ +{ + "description": "changeStreams-client.watch-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + } + ], + "tests": [ + { + "description": "client.watch succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.yml b/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.yml new file mode 100644 index 0000000000..7b6b8bbdf9 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-client.watch-serverErrors.yml @@ -0,0 +1,359 @@ +description: changeStreams-client.watch-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + +tests: + - + description: 'client.watch succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11600 + - &retryable_operation + object: *client0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: 1 + cursor: { } + pipeline: + - + $changeStream: + allChangesForCluster: true + databaseName: admin + - *retryable_command_started_event + - + description: 'client.watch succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + errorCode: 10107 + - &retryable_operation_fails + object: *client0 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - <<: *retryable_operation_fails + object: *client1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/changeStreams-client.watch.json b/source/retryable-reads/tests/unified/changeStreams-client.watch.json new file mode 100644 index 0000000000..95ddaf921d --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-client.watch.json @@ -0,0 +1,294 @@ +{ + "description": "changeStreams-client.watch", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + } + ], + "tests": [ + { + "description": "client.watch succeeds on first attempt", + "operations": [ + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "client.watch fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true + } + } + ] + }, + "databaseName": "admin" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-client.watch.yml b/source/retryable-reads/tests/unified/changeStreams-client.watch.yml new file mode 100644 index 0000000000..2fa3a300bc --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-client.watch.yml @@ -0,0 +1,131 @@ +description: changeStreams-client.watch + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + +tests: + - + description: 'client.watch succeeds on first attempt' + operations: + - &retryable_operation + object: *client0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: 1 + cursor: { } + pipeline: + - + $changeStream: + allChangesForCluster: true + databaseName: admin + - + description: 'client.watch succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'client.watch fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *client1 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'client.watch fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + closeConnection: true + - <<: *retryable_operation_fails + object: *client0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.json b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.json new file mode 100644 index 0000000000..589d0a3c37 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.json @@ -0,0 +1,944 @@ +{ + "description": "changeStreams-db.coll.watch-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "db.coll.watch succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.yml b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.yml new file mode 100644 index 0000000000..8dc05560bc --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch-serverErrors.yml @@ -0,0 +1,382 @@ +description: changeStreams-db.coll.watch-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'db.coll.watch succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11600 + - &retryable_operation + object: *collection0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + cursor: { } + pipeline: + - + $changeStream: { } + databaseName: *database_name + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.json b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.json new file mode 100644 index 0000000000..bbea2ffe4f --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.json @@ -0,0 +1,314 @@ +{ + "description": "changeStreams-db.coll.watch", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "db.coll.watch succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.coll.watch fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.yml b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.yml new file mode 100644 index 0000000000..8106382283 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.coll.watch.yml @@ -0,0 +1,152 @@ +description: changeStreams-db.coll.watch + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'db.coll.watch succeeds on first attempt' + operations: + - &retryable_operation + object: *collection0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + cursor: { } + pipeline: + - + $changeStream: { } + databaseName: *database_name + - + description: 'db.coll.watch succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.coll.watch fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'db.coll.watch fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.json b/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.json new file mode 100644 index 0000000000..6c12d7ddd8 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.json @@ -0,0 +1,930 @@ +{ + "description": "changeStreams-db.watch-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "db.watch succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.yml b/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.yml new file mode 100644 index 0000000000..a90a802d91 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.watch-serverErrors.yml @@ -0,0 +1,373 @@ +description: changeStreams-db.watch-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'db.watch succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11600 + - &retryable_operation + object: *database0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: 1 + cursor: { } + pipeline: + - + $changeStream: { } + databaseName: *database_name + - *retryable_command_started_event + - + description: 'db.watch succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + errorCode: 10107 + - &retryable_operation_fails + object: *database0 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - <<: *retryable_operation_fails + object: *database1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/changeStreams-db.watch.json b/source/retryable-reads/tests/unified/changeStreams-db.watch.json new file mode 100644 index 0000000000..1b6d911c76 --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.watch.json @@ -0,0 +1,303 @@ +{ + "description": "changeStreams-db.watch", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "db.watch succeeds on first attempt", + "operations": [ + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "killCursors" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database1", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "db.watch fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "createChangeStream", + "arguments": { + "pipeline": [] + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": {} + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/changeStreams-db.watch.yml b/source/retryable-reads/tests/unified/changeStreams-db.watch.yml new file mode 100644 index 0000000000..47cbc0457d --- /dev/null +++ b/source/retryable-reads/tests/unified/changeStreams-db.watch.yml @@ -0,0 +1,145 @@ +description: changeStreams-db.watch + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - replicaset + - + minServerVersion: 4.1.7 + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'db.watch succeeds on first attempt' + operations: + - &retryable_operation + object: *database0 + name: createChangeStream + arguments: + pipeline: [] + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: 1 + cursor: { } + pipeline: + - + $changeStream: { } + databaseName: *database_name + - + description: 'db.watch succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'db.watch fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + ignoreCommandMonitoringEvents: + - killCursors + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *database1 + name: createChangeStream + arguments: + pipeline: [] + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'db.watch fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + closeConnection: true + - <<: *retryable_operation_fails + object: *database0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/count-serverErrors.json b/source/retryable-reads/tests/unified/count-serverErrors.json new file mode 100644 index 0000000000..c52edfdb98 --- /dev/null +++ b/source/retryable-reads/tests/unified/count-serverErrors.json @@ -0,0 +1,808 @@ +{ + "description": "count-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "Count succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "count", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/count-serverErrors.yml b/source/retryable-reads/tests/unified/count-serverErrors.yml new file mode 100644 index 0000000000..a433aaa87d --- /dev/null +++ b/source/retryable-reads/tests/unified/count-serverErrors.yml @@ -0,0 +1,381 @@ +description: count-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + +tests: + - + description: 'Count succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: count + arguments: + filter: { } + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + count: *collection_name + databaseName: *database_name + - *retryable_command_started_event + - + description: 'Count succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - count + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: count + arguments: + filter: { } + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/count.json b/source/retryable-reads/tests/unified/count.json new file mode 100644 index 0000000000..d5c9a343a9 --- /dev/null +++ b/source/retryable-reads/tests/unified/count.json @@ -0,0 +1,286 @@ +{ + "description": "count", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "Count succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "count", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Count fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "count", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/count.yml b/source/retryable-reads/tests/unified/count.yml new file mode 100644 index 0000000000..912f7578b4 --- /dev/null +++ b/source/retryable-reads/tests/unified/count.yml @@ -0,0 +1,153 @@ +description: count + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + +tests: + - + description: 'Count succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: count + arguments: + filter: { } + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + count: *collection_name + databaseName: *database_name + - + description: 'Count succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Count fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: count + arguments: + filter: { } + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'Count fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - count + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/countDocuments-serverErrors.json b/source/retryable-reads/tests/unified/countDocuments-serverErrors.json new file mode 100644 index 0000000000..fd028b114c --- /dev/null +++ b/source/retryable-reads/tests/unified/countDocuments-serverErrors.json @@ -0,0 +1,1133 @@ +{ + "description": "countDocuments-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "CountDocuments succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/countDocuments-serverErrors.yml b/source/retryable-reads/tests/unified/countDocuments-serverErrors.yml new file mode 100644 index 0000000000..2bcca604f2 --- /dev/null +++ b/source/retryable-reads/tests/unified/countDocuments-serverErrors.yml @@ -0,0 +1,386 @@ +description: countDocuments-serverErrors +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 +tests: + - + description: 'CountDocuments succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: countDocuments + arguments: + filter: { } + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: + - + $match: { } + - + $group: + _id: 1 + 'n': { $sum: 1 } + databaseName: *database_name + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: countDocuments + arguments: + filter: { } + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/countDocuments.json b/source/retryable-reads/tests/unified/countDocuments.json new file mode 100644 index 0000000000..e06e89c1ad --- /dev/null +++ b/source/retryable-reads/tests/unified/countDocuments.json @@ -0,0 +1,364 @@ +{ + "description": "countDocuments", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "CountDocuments succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "CountDocuments fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "countDocuments", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": {} + }, + { + "$group": { + "_id": 1, + "n": { + "$sum": 1 + } + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/countDocuments.yml b/source/retryable-reads/tests/unified/countDocuments.yml new file mode 100644 index 0000000000..725137deef --- /dev/null +++ b/source/retryable-reads/tests/unified/countDocuments.yml @@ -0,0 +1,158 @@ +description: countDocuments +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 +tests: + - + description: 'CountDocuments succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: countDocuments + arguments: + filter: { } + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + aggregate: *collection_name + pipeline: + - + $match: { } + - + $group: + _id: 1 + 'n': { $sum: 1 } + databaseName: *database_name + - + description: 'CountDocuments succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - aggregate + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'CountDocuments fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: countDocuments + arguments: + filter: { } + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'CountDocuments fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - aggregate + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/distinct-serverErrors.json b/source/retryable-reads/tests/unified/distinct-serverErrors.json new file mode 100644 index 0000000000..79d2d5fc31 --- /dev/null +++ b/source/retryable-reads/tests/unified/distinct-serverErrors.json @@ -0,0 +1,1060 @@ +{ + "description": "distinct-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Distinct succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/distinct-serverErrors.yml b/source/retryable-reads/tests/unified/distinct-serverErrors.yml new file mode 100644 index 0000000000..999e0b3fa0 --- /dev/null +++ b/source/retryable-reads/tests/unified/distinct-serverErrors.yml @@ -0,0 +1,396 @@ +description: distinct-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + +tests: + - + description: 'Distinct succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: distinct + arguments: + fieldName: x + filter: + _id: + $gt: 1 + expectResult: + - 22 + - 33 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + distinct: *collection_name + key: x + query: + _id: + $gt: 1 + databaseName: *database_name + - *retryable_command_started_event + - + description: 'Distinct succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - distinct + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: distinct + arguments: + fieldName: x + filter: + _id: + $gt: 1 + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/distinct.json b/source/retryable-reads/tests/unified/distinct.json new file mode 100644 index 0000000000..81f1f66e91 --- /dev/null +++ b/source/retryable-reads/tests/unified/distinct.json @@ -0,0 +1,352 @@ +{ + "description": "distinct", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Distinct succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectResult": [ + 22, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "distinct" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Distinct fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "distinct" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "distinct", + "arguments": { + "fieldName": "x", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "coll", + "key": "x", + "query": { + "_id": { + "$gt": 1 + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/distinct.yml b/source/retryable-reads/tests/unified/distinct.yml new file mode 100644 index 0000000000..9b6f1648d7 --- /dev/null +++ b/source/retryable-reads/tests/unified/distinct.yml @@ -0,0 +1,168 @@ +description: distinct + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + +tests: + - + description: 'Distinct succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: distinct + arguments: + fieldName: x + filter: + _id: + $gt: 1 + expectResult: + - 22 + - 33 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + distinct: *collection_name + key: x + query: + _id: + $gt: 1 + databaseName: *database_name + - + description: 'Distinct succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - distinct + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Distinct fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: distinct + arguments: + fieldName: x + filter: + _id: + $gt: 1 + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'Distinct fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - distinct + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.json b/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.json new file mode 100644 index 0000000000..ba983c6cdf --- /dev/null +++ b/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.json @@ -0,0 +1,768 @@ +{ + "description": "estimatedDocumentCount-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "EstimatedDocumentCount succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "estimatedDocumentCount", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.yml b/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.yml new file mode 100644 index 0000000000..98fa5ec9f7 --- /dev/null +++ b/source/retryable-reads/tests/unified/estimatedDocumentCount-serverErrors.yml @@ -0,0 +1,376 @@ +description: estimatedDocumentCount-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + +tests: + - + description: 'EstimatedDocumentCount succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: estimatedDocumentCount + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + count: *collection_name + databaseName: *database_name + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - count + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: estimatedDocumentCount + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/estimatedDocumentCount.json b/source/retryable-reads/tests/unified/estimatedDocumentCount.json new file mode 100644 index 0000000000..75a676b9b6 --- /dev/null +++ b/source/retryable-reads/tests/unified/estimatedDocumentCount.json @@ -0,0 +1,273 @@ +{ + "description": "estimatedDocumentCount", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "EstimatedDocumentCount succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectResult": 2 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "estimatedDocumentCount", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "EstimatedDocumentCount fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "count" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "estimatedDocumentCount", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "count": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/estimatedDocumentCount.yml b/source/retryable-reads/tests/unified/estimatedDocumentCount.yml new file mode 100644 index 0000000000..a4cac5a64e --- /dev/null +++ b/source/retryable-reads/tests/unified/estimatedDocumentCount.yml @@ -0,0 +1,148 @@ +description: estimatedDocumentCount + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + +tests: + - + description: 'EstimatedDocumentCount succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: estimatedDocumentCount + expectResult: 2 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + count: *collection_name + databaseName: *database_name + - + description: 'EstimatedDocumentCount succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - count + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: estimatedDocumentCount + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'EstimatedDocumentCount fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - count + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/find-serverErrors.json b/source/retryable-reads/tests/unified/find-serverErrors.json new file mode 100644 index 0000000000..ab3dbe45f4 --- /dev/null +++ b/source/retryable-reads/tests/unified/find-serverErrors.json @@ -0,0 +1,1184 @@ +{ + "description": "find-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + }, + { + "_id": 5, + "x": 55 + } + ] + } + ], + "tests": [ + { + "description": "Find succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/find-serverErrors.yml b/source/retryable-reads/tests/unified/find-serverErrors.yml new file mode 100644 index 0000000000..039cf25d95 --- /dev/null +++ b/source/retryable-reads/tests/unified/find-serverErrors.yml @@ -0,0 +1,412 @@ +description: find-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + - + _id: 5 + x: 55 + +tests: + - + description: 'Find succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: find + arguments: + filter: { } + sort: + _id: 1 + limit: 4 + expectResult: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *collection_name + filter: { } + sort: + _id: 1 + limit: 4 + databaseName: *database_name + - *retryable_command_started_event + - + description: 'Find succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: find + arguments: + filter: { } + sort: + _id: 1 + limit: 4 + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/find.json b/source/retryable-reads/tests/unified/find.json new file mode 100644 index 0000000000..30c4c5e478 --- /dev/null +++ b/source/retryable-reads/tests/unified/find.json @@ -0,0 +1,498 @@ +{ + "description": "find", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + }, + { + "_id": 5, + "x": 55 + } + ] + } + ], + "tests": [ + { + "description": "Find succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds on second attempt with explicit clientOptions", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": true + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "find", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 4 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/find.yml b/source/retryable-reads/tests/unified/find.yml new file mode 100644 index 0000000000..bcd98684cc --- /dev/null +++ b/source/retryable-reads/tests/unified/find.yml @@ -0,0 +1,221 @@ +description: find + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + - + _id: 5 + x: 55 + +tests: + - + description: 'Find succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: find + arguments: + filter: { } + sort: + _id: 1 + limit: 4 + expectResult: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *collection_name + filter: { } + sort: + _id: 1 + limit: 4 + databaseName: *database_name + - + description: 'Find succeeds on second attempt with explicit clientOptions' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: true + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + closeConnection: true + - <<: *retryable_operation_succeeds + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: *failCommand_failPoint + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Find fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: find + arguments: + filter: { } + sort: + _id: 1 + limit: 4 + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'Find fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/findOne-serverErrors.json b/source/retryable-reads/tests/unified/findOne-serverErrors.json new file mode 100644 index 0000000000..7adda1e32b --- /dev/null +++ b/source/retryable-reads/tests/unified/findOne-serverErrors.json @@ -0,0 +1,954 @@ +{ + "description": "findOne-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + }, + { + "_id": 5, + "x": 55 + } + ] + } + ], + "tests": [ + { + "description": "FindOne succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/findOne-serverErrors.yml b/source/retryable-reads/tests/unified/findOne-serverErrors.yml new file mode 100644 index 0000000000..48e461f11b --- /dev/null +++ b/source/retryable-reads/tests/unified/findOne-serverErrors.yml @@ -0,0 +1,396 @@ +description: findOne-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + - + _id: 5 + x: 55 + +tests: + - + description: 'FindOne succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11600 + - &retryable_operation_succeeds + object: *collection0 + name: findOne + arguments: + filter: + _id: 1 + expectResult: + _id: 1 + x: 11 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *collection_name + filter: + _id: 1 + databaseName: *database_name + - *retryable_command_started_event + - + description: 'FindOne succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11602 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13435 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13436 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 189 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 91 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 7 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 6 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 89 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 9001 + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: findOne + arguments: + filter: + _id: 1 + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/findOne.json b/source/retryable-reads/tests/unified/findOne.json new file mode 100644 index 0000000000..4314a19e46 --- /dev/null +++ b/source/retryable-reads/tests/unified/findOne.json @@ -0,0 +1,330 @@ +{ + "description": "findOne", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + }, + { + "_id": 5, + "x": 55 + } + ] + } + ], + "tests": [ + { + "description": "FindOne succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "FindOne fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "findOne", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": { + "_id": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/findOne.yml b/source/retryable-reads/tests/unified/findOne.yml new file mode 100644 index 0000000000..e4de9d77f0 --- /dev/null +++ b/source/retryable-reads/tests/unified/findOne.yml @@ -0,0 +1,168 @@ +description: findOne + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 11 + - + _id: 2 + x: 22 + - + _id: 3 + x: 33 + - + _id: 4 + x: 44 + - + _id: 5 + x: 55 + +tests: + - + description: 'FindOne succeeds on first attempt' + operations: + - &retryable_operation_succeeds + object: *collection0 + name: findOne + arguments: + filter: + _id: 1 + expectResult: + _id: 1 + x: 11 + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *collection_name + filter: + _id: 1 + databaseName: *database_name + - + description: 'FindOne succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + closeConnection: true + - *retryable_operation_succeeds + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'FindOne fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: findOne + arguments: + filter: + _id: 1 + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'FindOne fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/gridfs-download-serverErrors.json b/source/retryable-reads/tests/unified/gridfs-download-serverErrors.json new file mode 100644 index 0000000000..5bb7eee0b2 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-download-serverErrors.json @@ -0,0 +1,1092 @@ +{ + "description": "gridfs-download-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0" + } + } + ], + "initialData": [ + { + "collectionName": "fs.files", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000001" + }, + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" + }, + "filename": "abc", + "metadata": {} + } + ] + }, + { + "collectionName": "fs.chunks", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000002" + }, + "files_id": { + "$oid": "000000000000000000000001" + }, + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" + } + } + } + ] + } + ], + "tests": [ + { + "description": "Download succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket1", + "database": "database1" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket1", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/gridfs-download-serverErrors.yml b/source/retryable-reads/tests/unified/gridfs-download-serverErrors.yml new file mode 100644 index 0000000000..b7942f6f51 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-download-serverErrors.yml @@ -0,0 +1,421 @@ +description: gridfs-download-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + bucket: + id: &bucket0 bucket0 + database: *database0 + +initialData: + - + collectionName: &files_collection_name fs.files + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000001' + length: 1 + chunkSize: 4 + uploadDate: + $date: '1970-01-01T00:00:00.000Z' + filename: abc + metadata: { } + - + collectionName: &chunks_collection_name fs.chunks + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000002' + files_id: + $oid: '000000000000000000000001' + 'n': 0 + data: + $binary: + base64: EQ== # hex: 11 + subType: '00' + +tests: + - + description: 'Download succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11600 + - &retryable_operation + object: *bucket0 + name: download + arguments: + id: + $oid: '000000000000000000000001' + expectResult: + $$matchesHexBytes: "11" + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *files_collection_name + filter: + _id: + $oid: '000000000000000000000001' + databaseName: *database_name + - *retryable_command_started_event + - &find_chunks_command_started_event + commandStartedEvent: + command: + find: *chunks_collection_name + # Avoid checking additional fields since the exact query may + # differ among drivers. expectResult is sufficient to assert + # correctness. + databaseName: *database_name + - + description: 'Download succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + errorCode: 10107 + - &retryable_operation_fails + object: *bucket0 + name: download + arguments: + id: + $oid: '000000000000000000000001' + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'Download fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + bucket: + id: &bucket1 bucket1 + database: *database1 + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - <<: *retryable_operation_fails + object: *bucket1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/gridfs-download.json b/source/retryable-reads/tests/unified/gridfs-download.json new file mode 100644 index 0000000000..69fe8ff7c8 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-download.json @@ -0,0 +1,367 @@ +{ + "description": "gridfs-download", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0" + } + } + ], + "initialData": [ + { + "collectionName": "fs.files", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000001" + }, + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" + }, + "filename": "abc", + "metadata": {} + } + ] + }, + { + "collectionName": "fs.chunks", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000002" + }, + "files_id": { + "$oid": "000000000000000000000001" + }, + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" + } + } + } + ] + } + ], + "tests": [ + { + "description": "Download succeeds on first attempt", + "operations": [ + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket1", + "database": "database1" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket1", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Download fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket0", + "name": "download", + "arguments": { + "id": { + "$oid": "000000000000000000000001" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "_id": { + "$oid": "000000000000000000000001" + } + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/gridfs-download.yml b/source/retryable-reads/tests/unified/gridfs-download.yml new file mode 100644 index 0000000000..8164e7e826 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-download.yml @@ -0,0 +1,184 @@ +description: gridfs-download + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + bucket: + id: &bucket0 bucket0 + database: *database0 + +initialData: + - + collectionName: &files_collection_name fs.files + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000001' + length: 1 + chunkSize: 4 + uploadDate: + $date: '1970-01-01T00:00:00.000Z' + filename: abc + metadata: { } + - + collectionName: &chunks_collection_name fs.chunks + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000002' + files_id: + $oid: '000000000000000000000001' + 'n': 0 + data: + $binary: + base64: EQ== # hex: 11 + subType: '00' + +tests: + - + description: 'Download succeeds on first attempt' + operations: + - &retryable_operation + object: *bucket0 + name: download + arguments: + id: + $oid: '000000000000000000000001' + expectResult: + $$matchesHexBytes: "11" + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *files_collection_name + filter: + _id: + $oid: '000000000000000000000001' + databaseName: *database_name + - &find_chunks_command_started_event + commandStartedEvent: + command: + find: *chunks_collection_name + # Avoid checking additional fields since the exact query may + # differ among drivers. expectResult is sufficient to assert + # correctness. + databaseName: *database_name + - + description: 'Download succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'Download fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + bucket: + id: &bucket1 bucket1 + database: *database1 + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *bucket1 + name: download + arguments: + id: + $oid: '000000000000000000000001' + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'Download fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + closeConnection: true + - <<: *retryable_operation_fails + object: *bucket0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.json b/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.json new file mode 100644 index 0000000000..35f7e1e563 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.json @@ -0,0 +1,1016 @@ +{ + "description": "gridfs-downloadByName-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0" + } + } + ], + "initialData": [ + { + "collectionName": "fs.files", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000001" + }, + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" + }, + "filename": "abc", + "metadata": {} + } + ] + }, + { + "collectionName": "fs.chunks", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000002" + }, + "files_id": { + "$oid": "000000000000000000000001" + }, + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" + } + } + } + ] + } + ], + "tests": [ + { + "description": "DownloadByName succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket1", + "database": "database1" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "bucket1", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.yml b/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.yml new file mode 100644 index 0000000000..04d1c809d9 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-downloadByName-serverErrors.yml @@ -0,0 +1,418 @@ +description: gridfs-downloadByName-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + bucket: + id: &bucket0 bucket0 + database: *database0 + +initialData: + - + collectionName: &files_collection_name fs.files + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000001' + length: 1 + chunkSize: 4 + uploadDate: + $date: '1970-01-01T00:00:00.000Z' + filename: abc + metadata: { } + - + collectionName: &chunks_collection_name fs.chunks + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000002' + files_id: + $oid: '000000000000000000000001' + 'n': 0 + data: + $binary: + base64: EQ== # hex: 11 + subType: '00' + +tests: + - + description: 'DownloadByName succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11600 + - &retryable_operation + object: *bucket0 + name: downloadByName + arguments: + filename: abc + expectResult: + $$matchesHexBytes: "11" + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *files_collection_name + filter: + filename: abc + databaseName: *database_name + - *retryable_command_started_event + - &find_chunks_command_started_event + commandStartedEvent: + command: + find: *chunks_collection_name + # Avoid checking additional fields since the exact query may + # differ among drivers. expectResult is sufficient to assert + # correctness. + databaseName: *database_name + - + description: 'DownloadByName succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + errorCode: 10107 + - &retryable_operation_fails + object: *bucket0 + name: downloadByName + arguments: + filename: abc + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'DownloadByName fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + bucket: + id: &bucket1 bucket1 + database: *database1 + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + errorCode: 10107 + - <<: *retryable_operation_fails + object: *bucket1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/gridfs-downloadByName.json b/source/retryable-reads/tests/unified/gridfs-downloadByName.json new file mode 100644 index 0000000000..c3fa873396 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-downloadByName.json @@ -0,0 +1,347 @@ +{ + "description": "gridfs-downloadByName", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0" + } + } + ], + "initialData": [ + { + "collectionName": "fs.files", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000001" + }, + "length": 1, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" + }, + "filename": "abc", + "metadata": {} + } + ] + }, + { + "collectionName": "fs.chunks", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000002" + }, + "files_id": { + "$oid": "000000000000000000000001" + }, + "n": 0, + "data": { + "$binary": { + "base64": "EQ==", + "subType": "00" + } + } + } + ] + } + ], + "tests": [ + { + "description": "DownloadByName succeeds on first attempt", + "operations": [ + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectResult": { + "$$matchesHexBytes": "11" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.chunks" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "bucket": { + "id": "bucket1", + "database": "database1" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket1", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "DownloadByName fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "object": "bucket0", + "name": "downloadByName", + "arguments": { + "filename": "abc" + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "fs.files", + "filter": { + "filename": "abc" + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/gridfs-downloadByName.yml b/source/retryable-reads/tests/unified/gridfs-downloadByName.yml new file mode 100644 index 0000000000..403c4c29c7 --- /dev/null +++ b/source/retryable-reads/tests/unified/gridfs-downloadByName.yml @@ -0,0 +1,180 @@ +description: gridfs-downloadByName + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + bucket: + id: &bucket0 bucket0 + database: *database0 + +initialData: + - + collectionName: &files_collection_name fs.files + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000001' + length: 1 + chunkSize: 4 + uploadDate: + $date: '1970-01-01T00:00:00.000Z' + filename: abc + metadata: { } + - + collectionName: &chunks_collection_name fs.chunks + databaseName: *database_name + documents: + - + _id: + $oid: '000000000000000000000002' + files_id: + $oid: '000000000000000000000001' + 'n': 0 + data: + $binary: + base64: EQ== # hex: 11 + subType: '00' +tests: + - + description: 'DownloadByName succeeds on first attempt' + operations: + - &retryable_operation + object: *bucket0 + name: downloadByName + arguments: + filename: abc + expectResult: + $$matchesHexBytes: "11" + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + find: *files_collection_name + filter: + filename: abc + databaseName: *database_name + - &find_chunks_command_started_event + commandStartedEvent: + command: + find: *chunks_collection_name + # Avoid checking additional fields since the exact query may + # differ among drivers. expectResult is sufficient to assert + # correctness. + databaseName: *database_name + - + description: 'DownloadByName succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - find + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - *find_chunks_command_started_event + - + description: 'DownloadByName fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + bucket: + id: &bucket1 bucket1 + database: *database1 + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *bucket1 + name: downloadByName + arguments: + filename: abc + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'DownloadByName fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - find + closeConnection: true + - <<: *retryable_operation_fails + object: *bucket0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.json b/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.json new file mode 100644 index 0000000000..162dd4cee0 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.json @@ -0,0 +1,710 @@ +{ + "description": "listCollectionNames-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollectionNames succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database1", + "name": "listCollectionNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.yml b/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.yml new file mode 100644 index 0000000000..bba0407d99 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionNames-serverErrors.yml @@ -0,0 +1,360 @@ +description: listCollectionNames-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollectionNames succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11600 + - &retryable_operation + object: *database0 + name: listCollectionNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + errorCode: 10107 + - &retryable_operation_fails + object: *database0 + name: listCollectionNames + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - <<: *retryable_operation_fails + object: *database1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listCollectionNames.json b/source/retryable-reads/tests/unified/listCollectionNames.json new file mode 100644 index 0000000000..0fe575f7a6 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionNames.json @@ -0,0 +1,243 @@ +{ + "description": "listCollectionNames", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollectionNames succeeds on first attempt", + "operations": [ + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database1", + "name": "listCollectionNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionNames fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollectionNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollectionNames.yml b/source/retryable-reads/tests/unified/listCollectionNames.yml new file mode 100644 index 0000000000..7522f1d093 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionNames.yml @@ -0,0 +1,132 @@ +description: listCollectionNames + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollectionNames succeeds on first attempt' + operations: + - &retryable_operation + object: *database0 + name: listCollectionNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - + description: 'ListCollectionNames succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionNames fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *database1 + name: listCollectionNames + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListCollectionNames fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + closeConnection: true + - <<: *retryable_operation_fails + object: *database0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.json b/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.json new file mode 100644 index 0000000000..8b9d582c10 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.json @@ -0,0 +1,710 @@ +{ + "description": "listCollectionObjects-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollectionObjects succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database1", + "name": "listCollectionObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.yml b/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.yml new file mode 100644 index 0000000000..758c6165de --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionObjects-serverErrors.yml @@ -0,0 +1,364 @@ +# listCollectionObjects returns an array of MongoCollection objects. +# Not all drivers support this functionality. For more details, see: +# https://github.com/mongodb/specifications/blob/v1/source/enumerate-collections.rst#returning-a-list-of-collection-objects + +description: listCollectionObjects-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollectionObjects succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11600 + - &retryable_operation + object: *database0 + name: listCollectionObjects + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + errorCode: 10107 + - &retryable_operation_fails + object: *database0 + name: listCollectionObjects + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - <<: *retryable_operation_fails + object: *database1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listCollectionObjects.json b/source/retryable-reads/tests/unified/listCollectionObjects.json new file mode 100644 index 0000000000..9cdbb69276 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionObjects.json @@ -0,0 +1,243 @@ +{ + "description": "listCollectionObjects", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollectionObjects succeeds on first attempt", + "operations": [ + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database1", + "name": "listCollectionObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollectionObjects fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollectionObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollectionObjects.yml b/source/retryable-reads/tests/unified/listCollectionObjects.yml new file mode 100644 index 0000000000..93da6bd85e --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollectionObjects.yml @@ -0,0 +1,136 @@ +# listCollectionObjects returns an array of MongoCollection objects. +# Not all drivers support this functionality. For more details, see: +# https://github.com/mongodb/specifications/blob/v1/source/enumerate-collections.rst#returning-a-list-of-collection-objects + +description: listCollectionObjects + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollectionObjects succeeds on first attempt' + operations: + - &retryable_operation + object: *database0 + name: listCollectionObjects + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - + description: 'ListCollectionObjects succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollectionObjects fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *database1 + name: listCollectionObjects + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListCollectionObjects fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + closeConnection: true + - <<: *retryable_operation_fails + object: *database0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event \ No newline at end of file diff --git a/source/retryable-reads/tests/unified/listCollections-serverErrors.json b/source/retryable-reads/tests/unified/listCollections-serverErrors.json new file mode 100644 index 0000000000..171fe7457f --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollections-serverErrors.json @@ -0,0 +1,710 @@ +{ + "description": "listCollections-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollections succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database0", + "name": "listCollections", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "database1", + "name": "listCollections", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollections-serverErrors.yml b/source/retryable-reads/tests/unified/listCollections-serverErrors.yml new file mode 100644 index 0000000000..12fb42f02a --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollections-serverErrors.yml @@ -0,0 +1,360 @@ +description: listCollections-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollections succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11600 + - &retryable_operation + object: *database0 + name: listCollections + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - *retryable_command_started_event + - + description: 'ListCollections succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + errorCode: 10107 + - &retryable_operation_fails + object: *database0 + name: listCollections + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + errorCode: 10107 + - <<: *retryable_operation_fails + object: *database1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listCollections.json b/source/retryable-reads/tests/unified/listCollections.json new file mode 100644 index 0000000000..b6152f9ce5 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollections.json @@ -0,0 +1,243 @@ +{ + "description": "listCollections", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListCollections succeeds on first attempt", + "operations": [ + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollections" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database1", + "name": "listCollections", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListCollections fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listCollections" + ], + "closeConnection": true + } + } + } + }, + { + "object": "database0", + "name": "listCollections", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listCollections": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listCollections.yml b/source/retryable-reads/tests/unified/listCollections.yml new file mode 100644 index 0000000000..1dcfe1ef48 --- /dev/null +++ b/source/retryable-reads/tests/unified/listCollections.yml @@ -0,0 +1,132 @@ +description: listCollections + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + +initialData: + - + collectionName: &collection_name coll + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListCollections succeeds on first attempt' + operations: + - &retryable_operation + object: *database0 + name: listCollections + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listCollections: 1 + - + description: 'ListCollections succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listCollections + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListCollections fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *database1 + name: listCollections + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListCollections fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listCollections + closeConnection: true + - <<: *retryable_operation_fails + object: *database0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.json b/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.json new file mode 100644 index 0000000000..489ff0ad51 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.json @@ -0,0 +1,696 @@ +{ + "description": "listDatabaseNames-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabaseNames succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client1", + "name": "listDatabaseNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.yml b/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.yml new file mode 100644 index 0000000000..36db2a1907 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseNames-serverErrors.yml @@ -0,0 +1,351 @@ +description: listDatabaseNames-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabaseNames succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11600 + - &retryable_operation + object: *client0 + name: listDatabaseNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + errorCode: 10107 + - &retryable_operation_fails + object: *client0 + name: listDatabaseNames + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - <<: *retryable_operation_fails + object: *client1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listDatabaseNames.json b/source/retryable-reads/tests/unified/listDatabaseNames.json new file mode 100644 index 0000000000..5590f39a51 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseNames.json @@ -0,0 +1,229 @@ +{ + "description": "listDatabaseNames", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabaseNames succeeds on first attempt", + "operations": [ + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client1", + "name": "listDatabaseNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseNames fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabaseNames.yml b/source/retryable-reads/tests/unified/listDatabaseNames.yml new file mode 100644 index 0000000000..d80e7d6ebf --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseNames.yml @@ -0,0 +1,123 @@ +description: listDatabaseNames + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabaseNames succeeds on first attempt' + operations: + - &retryable_operation + object: *client0 + name: listDatabaseNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - + description: 'ListDatabaseNames succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseNames fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *client1 + name: listDatabaseNames + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListDatabaseNames fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + closeConnection: true + - <<: *retryable_operation_fails + object: *client0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.json b/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.json new file mode 100644 index 0000000000..56f9f36236 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.json @@ -0,0 +1,696 @@ +{ + "description": "listDatabaseObjects-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabaseObjects succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client1", + "name": "listDatabaseObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.yml b/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.yml new file mode 100644 index 0000000000..06815e1e8b --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseObjects-serverErrors.yml @@ -0,0 +1,355 @@ +# listDatabaseObjects returns an array of MongoDatabase objects. +# Not all drivers support this functionality. For more details, see: +# https://github.com/mongodb/specifications/blob/v1/source/enumerate-databases.rst#enumerating-mongodatabase-objects + +description: listDatabaseObjects-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabaseObjects succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11600 + - &retryable_operation + object: *client0 + name: listDatabaseObjects + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + errorCode: 10107 + - &retryable_operation_fails + object: *client0 + name: listDatabaseObjects + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - <<: *retryable_operation_fails + object: *client1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listDatabaseObjects.json b/source/retryable-reads/tests/unified/listDatabaseObjects.json new file mode 100644 index 0000000000..46b1511d46 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseObjects.json @@ -0,0 +1,229 @@ +{ + "description": "listDatabaseObjects", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabaseObjects succeeds on first attempt", + "operations": [ + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client1", + "name": "listDatabaseObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabaseObjects fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabaseObjects", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabaseObjects.yml b/source/retryable-reads/tests/unified/listDatabaseObjects.yml new file mode 100644 index 0000000000..3c94b6cca5 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabaseObjects.yml @@ -0,0 +1,127 @@ +# listDatabaseObjects returns an array of MongoDatabase objects. +# Not all drivers support this functionality. For more details, see: +# https://github.com/mongodb/specifications/blob/v1/source/enumerate-databases.rst#enumerating-mongodatabase-objects + +description: listDatabaseObjects + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabaseObjects succeeds on first attempt' + operations: + - &retryable_operation + object: *client0 + name: listDatabaseObjects + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - + description: 'ListDatabaseObjects succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabaseObjects fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *client1 + name: listDatabaseObjects + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListDatabaseObjects fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + closeConnection: true + - <<: *retryable_operation_fails + object: *client0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event \ No newline at end of file diff --git a/source/retryable-reads/tests/unified/listDatabases-serverErrors.json b/source/retryable-reads/tests/unified/listDatabases-serverErrors.json new file mode 100644 index 0000000000..09b935a59f --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabases-serverErrors.json @@ -0,0 +1,696 @@ +{ + "description": "listDatabases-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabases succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client0", + "name": "listDatabases", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "client1", + "name": "listDatabases", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabases-serverErrors.yml b/source/retryable-reads/tests/unified/listDatabases-serverErrors.yml new file mode 100644 index 0000000000..1a236bde39 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabases-serverErrors.yml @@ -0,0 +1,351 @@ +description: listDatabases-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabases succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11600 + - &retryable_operation + object: *client0 + name: listDatabases + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + errorCode: 10107 + - &retryable_operation_fails + object: *client0 + name: listDatabases + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + errorCode: 10107 + - <<: *retryable_operation_fails + object: *client1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listDatabases.json b/source/retryable-reads/tests/unified/listDatabases.json new file mode 100644 index 0000000000..4cf5eccc7b --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabases.json @@ -0,0 +1,229 @@ +{ + "description": "listDatabases", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListDatabases succeeds on first attempt", + "operations": [ + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabases" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client1", + "name": "listDatabases", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + }, + { + "description": "ListDatabases fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "object": "client0", + "name": "listDatabases", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listDatabases.yml b/source/retryable-reads/tests/unified/listDatabases.yml new file mode 100644 index 0000000000..743e4a4830 --- /dev/null +++ b/source/retryable-reads/tests/unified/listDatabases.yml @@ -0,0 +1,123 @@ +description: listDatabases + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + +initialData: + - + collectionName: &collection_name coll + databaseName: &database_name retryable-reads-tests + documents: [] + +tests: + - + description: 'ListDatabases succeeds on first attempt' + operations: + - &retryable_operation + object: *client0 + name: listDatabases + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listDatabases: 1 + - + description: 'ListDatabases succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listDatabases + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListDatabases fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *client1 + name: listDatabases + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListDatabases fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listDatabases + closeConnection: true + - <<: *retryable_operation_fails + object: *client0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event \ No newline at end of file diff --git a/source/retryable-reads/tests/unified/listIndexNames-serverErrors.json b/source/retryable-reads/tests/unified/listIndexNames-serverErrors.json new file mode 100644 index 0000000000..7b98111480 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexNames-serverErrors.json @@ -0,0 +1,749 @@ +{ + "description": "listIndexNames-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListIndexNames succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "listIndexNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listIndexNames-serverErrors.yml b/source/retryable-reads/tests/unified/listIndexNames-serverErrors.yml new file mode 100644 index 0000000000..aa217bbdcc --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexNames-serverErrors.yml @@ -0,0 +1,370 @@ +description: listIndexNames-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListIndexNames succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 11600 + - &retryable_operation + object: *collection0 + name: listIndexNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listIndexes: *collection_name + databaseName: *database_name + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listIndexes + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: listIndexNames + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listIndexNames.json b/source/retryable-reads/tests/unified/listIndexNames.json new file mode 100644 index 0000000000..c5fe967ff5 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexNames.json @@ -0,0 +1,263 @@ +{ + "description": "listIndexNames", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListIndexNames succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "listIndexNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexNames fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "listIndexNames", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listIndexNames.yml b/source/retryable-reads/tests/unified/listIndexNames.yml new file mode 100644 index 0000000000..f18c223c49 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexNames.yml @@ -0,0 +1,142 @@ +description: listIndexNames + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListIndexNames succeeds on first attempt' + operations: + - &retryable_operation + object: *collection0 + name: listIndexNames + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listIndexes: *collection_name + databaseName: *database_name + - + description: 'ListIndexNames succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexNames fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: listIndexNames + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListIndexNames fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listIndexes + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listIndexes-serverErrors.json b/source/retryable-reads/tests/unified/listIndexes-serverErrors.json new file mode 100644 index 0000000000..0110a0acd0 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexes-serverErrors.json @@ -0,0 +1,749 @@ +{ + "description": "listIndexes-serverErrors", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListIndexes succeeds after InterruptedAtShutdown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 11600 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after InterruptedDueToReplStateChange", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 11602 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after NotWritablePrimary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after NotPrimaryNoSecondaryOk", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 13435 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after NotPrimaryOrSecondary", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 13436 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after PrimarySteppedDown", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 189 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after ShutdownInProgress", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 91 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after HostNotFound", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 7 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after HostUnreachable", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 6 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after NetworkTimeout", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 89 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds after SocketException", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 9001 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes fails after two NotWritablePrimary errors", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes fails after NotWritablePrimary when retryReads is false", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "errorCode": 10107 + } + } + } + }, + { + "object": "collection1", + "name": "listIndexes", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listIndexes-serverErrors.yml b/source/retryable-reads/tests/unified/listIndexes-serverErrors.yml new file mode 100644 index 0000000000..964def3d10 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexes-serverErrors.yml @@ -0,0 +1,370 @@ +description: listIndexes-serverErrors + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListIndexes succeeds after InterruptedAtShutdown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 11600 + - &retryable_operation + object: *collection0 + name: listIndexes + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listIndexes: *collection_name + databaseName: *database_name + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after InterruptedDueToReplStateChange' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 11602 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after NotWritablePrimary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 10107 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after NotPrimaryNoSecondaryOk' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 13435 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after NotPrimaryOrSecondary' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 13436 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after PrimarySteppedDown' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 189 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after ShutdownInProgress' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 91 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after HostNotFound' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 7 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after HostUnreachable' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 6 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after NetworkTimeout' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 89 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes succeeds after SocketException' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 9001 + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes fails after two NotWritablePrimary errors' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listIndexes + errorCode: 10107 + - &retryable_operation_fails + object: *collection0 + name: listIndexes + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes fails after NotWritablePrimary when retryReads is false' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + errorCode: 10107 + - <<: *retryable_operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event diff --git a/source/retryable-reads/tests/unified/listIndexes.json b/source/retryable-reads/tests/unified/listIndexes.json new file mode 100644 index 0000000000..2560e4961c --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexes.json @@ -0,0 +1,263 @@ +{ + "description": "listIndexes", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "ListIndexes succeeds on first attempt", + "operations": [ + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes succeeds on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes fails on first attempt", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "listIndexes", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListIndexes fails on second attempt", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "listIndexes" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "listIndexes", + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "listIndexes": "coll" + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/listIndexes.yml b/source/retryable-reads/tests/unified/listIndexes.yml new file mode 100644 index 0000000000..9f3932a938 --- /dev/null +++ b/source/retryable-reads/tests/unified/listIndexes.yml @@ -0,0 +1,142 @@ +description: listIndexes + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: [] + +tests: + - + description: 'ListIndexes succeeds on first attempt' + operations: + - &retryable_operation + object: *collection0 + name: listIndexes + expectEvents: + - + client: *client0 + events: + - &retryable_command_started_event + commandStartedEvent: + command: + listIndexes: *collection_name + databaseName: *database_name + - + description: 'ListIndexes succeeds on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - listIndexes + closeConnection: true + - *retryable_operation + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event + - + description: 'ListIndexes fails on first attempt' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - &retryable_operation_fails + object: *collection1 + name: listIndexes + expectError: + isError: true + expectEvents: + - + client: *client1 + events: + - *retryable_command_started_event + - + description: 'ListIndexes fails on second attempt' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: + times: 2 + data: + failCommands: + - listIndexes + closeConnection: true + - <<: *retryable_operation_fails + object: *collection0 + expectEvents: + - + client: *client0 + events: + - *retryable_command_started_event + - *retryable_command_started_event \ No newline at end of file diff --git a/source/retryable-reads/tests/unified/mapReduce.json b/source/retryable-reads/tests/unified/mapReduce.json new file mode 100644 index 0000000000..745c0ef001 --- /dev/null +++ b/source/retryable-reads/tests/unified/mapReduce.json @@ -0,0 +1,284 @@ +{ + "description": "mapReduce", + "schemaVersion": "1.9", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "serverless": "forbid", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 0 + }, + { + "_id": 2, + "x": 1 + }, + { + "_id": 3, + "x": 2 + } + ] + } + ], + "tests": [ + { + "description": "MapReduce succeeds with retry on", + "operations": [ + { + "object": "collection0", + "name": "mapReduce", + "arguments": { + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "expectResult": [ + { + "_id": 0, + "value": 6 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "mapReduce": "coll", + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "MapReduce fails with retry on", + "operations": [ + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "mapReduce" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection0", + "name": "mapReduce", + "arguments": { + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "mapReduce": "coll", + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "MapReduce fails with retry off", + "operations": [ + { + "object": "testRunner", + "name": "createEntities", + "arguments": { + "entities": [ + { + "client": { + "id": "client1", + "useMultipleMongoses": false, + "uriOptions": { + "retryReads": false + }, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ] + } + }, + { + "object": "testRunner", + "name": "failPoint", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "mapReduce" + ], + "closeConnection": true + } + } + } + }, + { + "object": "collection1", + "name": "mapReduce", + "arguments": { + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "mapReduce": "coll", + "map": { + "$code": "function inc() { return emit(0, this.x + 1) }" + }, + "reduce": { + "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" + }, + "out": { + "inline": 1 + } + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/source/retryable-reads/tests/unified/mapReduce.yml b/source/retryable-reads/tests/unified/mapReduce.yml new file mode 100644 index 0000000000..10e88e9168 --- /dev/null +++ b/source/retryable-reads/tests/unified/mapReduce.yml @@ -0,0 +1,153 @@ +description: mapReduce + +schemaVersion: '1.9' + +runOnRequirements: + - + minServerVersion: '4.0' + topologies: + - single + - replicaset + - + minServerVersion: 4.1.7 + # serverless proxy does not support mapReduce operation + serverless: forbid + topologies: + - sharded + - load-balanced + +createEntities: + - + client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: + - commandStartedEvent + - + database: + id: &database0 database0 + client: *client0 + databaseName: &database_name retryable-reads-tests + - + collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name coll + +initialData: + - + collectionName: *collection_name + databaseName: *database_name + documents: + - + _id: 1 + x: 0 + - + _id: 2 + x: 1 + - + _id: 3 + x: 2 + +tests: + - + description: 'MapReduce succeeds with retry on' + operations: + - &operation_succeeds + object: *collection0 + name: mapReduce + arguments: + map: + $code: 'function inc() { return emit(0, this.x + 1) }' + reduce: + $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' + out: + inline: 1 + expectResult: + - + _id: 0 + value: 6 + expectEvents: + - + client: *client0 + events: + - &command_started_event + commandStartedEvent: + command: + mapReduce: *collection_name + map: + $code: 'function inc() { return emit(0, this.x + 1) }' + reduce: + $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' + out: + inline: 1 + databaseName: *database_name + - + description: 'MapReduce fails with retry on' + operations: + - + object: testRunner + name: failPoint + arguments: + client: *client0 + failPoint: &failCommand_failPoint + configureFailPoint: failCommand + mode: + times: 1 + data: + failCommands: + - mapReduce + closeConnection: true + - &operation_fails + object: *collection0 + name: mapReduce + arguments: + map: + $code: 'function inc() { return emit(0, this.x + 1) }' + reduce: + $code: 'function sum(key, values) { return values.reduce((acc, x) => acc + x); }' + out: + inline: 1 + expectError: + isError: true + expectEvents: + - + client: *client0 + events: + - *command_started_event + - + description: 'MapReduce fails with retry off' + operations: + - + object: testRunner + name: createEntities + arguments: + entities: + - client: + id: &client1 client1 + useMultipleMongoses: false + uriOptions: + retryReads: false + observeEvents: + - commandStartedEvent + - database: + id: &database1 database1 + client: *client1 + databaseName: *database_name + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collection_name + - + object: testRunner + name: failPoint + arguments: + client: *client1 + failPoint: *failCommand_failPoint + - <<: *operation_fails + object: *collection1 + expectEvents: + - + client: *client1 + events: + - *command_started_event diff --git a/source/run-command/run-command.rst b/source/run-command/run-command.rst index ab365366cc..2df404717c 100644 --- a/source/run-command/run-command.rst +++ b/source/run-command/run-command.rst @@ -287,7 +287,7 @@ Load Balancers When in ``loadBalanced`` mode, a driver MUST pin the connection used to execute the initial operation, and reuse it for subsequent ``getMore`` operations. -* See Load Balancer's section on `Behaviour With Cursors `_ +* See Load Balancer's section on `Behaviour With Cursors <../load-balancers/load-balancers.md#behaviour-with-cursors>`_ Iterating the Cursor """""""""""""""""""" diff --git a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst index 76dbd13f10..621aaacef9 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst @@ -853,7 +853,7 @@ type Unknown. TopologyType LoadBalanced ````````````````````````` -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#server-discovery-logging-and-monitoring>`__ for details. +See the `Load Balancer Specification <../load-balancers/load-balancers.md#server-discovery-logging-and-monitoring>`__ for details. Other TopologyTypes ``````````````````` diff --git a/source/server-selection/server-selection.md b/source/server-selection/server-selection.md index ed1b5a7b27..c8e86cf41a 100644 --- a/source/server-selection/server-selection.md +++ b/source/server-selection/server-selection.md @@ -78,7 +78,7 @@ An OP_QUERY operation targeting the '$cmd' collection namespace. A driver connection mode that sends all database operations to a single server without regard for type. -
+ **Eligible**\ Describes candidate servers that also meet the criteria specified by the `tag_sets` and @@ -778,7 +778,7 @@ The single server is always suitable for write operations if it is available. During command construction, drivers MUST add a $readPreference field to the command when required by [Passing read preference to mongos and load balancers](#passing-read-preference-to-mongos-and-load-balancers); see the -[Load Balancer Specification](../load-balancers/load-balancers.rst#server-selection) for details. +[Load Balancer Specification](../load-balancers/load-balancers.md#server-selection) for details. #### Topology types: ReplicaSetWithPrimary or ReplicaSetNoPrimary diff --git a/source/server-selection/server-selection.rst b/source/server-selection/server-selection.rst index 2085dfdb10..41087e1639 100644 --- a/source/server-selection/server-selection.rst +++ b/source/server-selection/server-selection.rst @@ -1010,7 +1010,7 @@ Topology type: LoadBalanced During command construction, drivers MUST add a $readPreference field to the command when required by `Passing read preference to mongos and load balancers`_; -see the `Load Balancer Specification <../load-balancers/load-balancers.rst#server-selection>`__ +see the `Load Balancer Specification <../load-balancers/load-balancers.md#server-selection>`__ for details. diff --git a/source/serverless-testing/README.rst b/source/serverless-testing/README.rst index 166fbce56c..64bde8da02 100644 --- a/source/serverless-testing/README.rst +++ b/source/serverless-testing/README.rst @@ -53,7 +53,7 @@ In contrast to the `Load Balancer testing`_, which has separate URIs for load balancers fronting a single or multiple servers, there is only a single URI for Atlas Serverless testing (i.e. ``SERVERLESS_URI``). -.. _Load Balancer testing: ../load-balancers/tests/README.rst +.. _Load Balancer testing: ../load-balancers/tests/README.md The TXT record for ``SERVERLESS_URI`` already specifies ``loadBalanced=true`` so drivers need not add that. diff --git a/source/sessions/driver-sessions.rst b/source/sessions/driver-sessions.rst index 36f4a40858..493bcc8ff7 100644 --- a/source/sessions/driver-sessions.rst +++ b/source/sessions/driver-sessions.rst @@ -837,7 +837,7 @@ Algorithm to acquire a ServerSession instance from the server session pool * If it has at least one minute left before becoming stale use this ``ServerSession`` * If it has less than one minute left before becoming stale discard it (let it be garbage collected) and return to step 1. -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#session-expiration>`__ +See the `Load Balancer Specification <../load-balancers/load-balancers.md#session-expiration>`__ for details on session expiration. diff --git a/source/transactions/transactions.md b/source/transactions/transactions.md index 171f239242..4fa5c6c7fc 100644 --- a/source/transactions/transactions.md +++ b/source/transactions/transactions.md @@ -652,7 +652,7 @@ called multiple times. #### Pinning in Load Balancer Mode -See the [Load Balancer Specification](../load-balancers/load-balancers.rst#connection-pooling) for details. +See the [Load Balancer Specification](../load-balancers/load-balancers.md#connection-pooling) for details. ### recoveryToken field diff --git a/source/transactions/transactions.rst b/source/transactions/transactions.rst index f7dc314e66..1178446360 100644 --- a/source/transactions/transactions.rst +++ b/source/transactions/transactions.rst @@ -842,7 +842,7 @@ the session as ``commitTransaction`` may be called multiple times. Pinning in Load Balancer Mode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -See the `Load Balancer Specification <../load-balancers/load-balancers.rst#connection-pooling>`__ for details. +See the `Load Balancer Specification <../load-balancers/load-balancers.md#connection-pooling>`__ for details. recoveryToken field diff --git a/source/unified-test-format/tests/Makefile b/source/unified-test-format/tests/Makefile index 3ed7ebdc50..ef0c50b862 100644 --- a/source/unified-test-format/tests/Makefile +++ b/source/unified-test-format/tests/Makefile @@ -1,8 +1,8 @@ SCHEMA=../schema-1.19.json -.PHONY: all invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions transactions-convenient-api crud collection-management retryable-writes sessions command-logging-and-monitoring client-side-operations-timeout HAS_AJV +.PHONY: all invalid valid-fail valid-pass atlas-data-lake versioned-api load-balancers gridfs transactions transactions-convenient-api crud collection-management read-write-concern retryable-reads retryable-writes sessions command-logging-and-monitoring client-side-operations-timeout HAS_AJV -all: invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions transactions-convenient-api change-streams crud collection-management retryable-writes sessions command-logging-and-monitoring client-side-operations-timeout client-side-encryption +all: invalid valid-fail valid-pass atlas-data-lake versioned-api load-balancers gridfs transactions transactions-convenient-api change-streams crud collection-management read-write-concern retryable-reads retryable-writes sessions command-logging-and-monitoring client-side-operations-timeout client-side-encryption invalid: HAS_AJV @# Redirect stdout to hide expected validation errors @@ -14,6 +14,9 @@ valid-fail: HAS_AJV valid-pass: HAS_AJV @ajv test -s $(SCHEMA) -d "valid-pass/*.yml" --valid +atlas-data-lake: HAS_AJV + @ajv test -s $(SCHEMA) -d "../../atlas-data-lake-testing/tests/unified/*.yml" --valid + versioned-api: HAS_AJV @ajv test -s $(SCHEMA) -d "../../versioned-api/tests/*.yml" --valid @@ -41,6 +44,12 @@ crud: HAS_AJV collection-management: HAS_AJV @ajv test -s $(SCHEMA) -d "../../collection-management/tests/*.yml" --valid +read-write-concern: HAS_AJV + @ajv test -s $(SCHEMA) -d "../../read-write-concern/tests/operation/*.yml" --valid + +retryable-reads: HAS_AJV + @ajv test -s $(SCHEMA) -d "../../retryable-reads/tests/unified/*.yml" --valid + retryable-writes: HAS_AJV @ajv test -s $(SCHEMA) -d "../../retryable-writes/tests/unified/*.yml" --valid diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index da0dabf03f..7b258084e8 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -188,7 +188,7 @@ Test runners MUST support the following types of entities: - ClientSession. See [entity_session](#entity_session) and [Session Operations](#session-operations). - GridFS Bucket. See [entity_bucket](#entity_bucket) and [Bucket Operations](#bucket-operations). -
+ - ChangeStream. Change stream entities are special in that they are not defined in [createEntities](#createentities) but are instead created by using [operation.saveResultAsEntity](#operation_saveResultAsEntity) with a @@ -223,14 +223,14 @@ Test runners MUST support the following types of entities: Tests SHOULD NOT utilize deprecated types (e.g. 0x0E: Symbol), since they may not be supported by all drivers and could yield runtime errors (e.g. while loading a test file with an Extended JSON parser). -
+ - Test runner thread. An entity representing a "thread" that can be used to concurrently execute operations. Thread entities MUST be able to run concurrently with the main test runner thread and other thread entities, but they do not have to be implemented as actual OS threads (e.g. they can be goroutines or async tasks). See [entity_thread_object](#entity_thread_object) for more information on how they are created. -
+ - TopologyDescription. An entity representing a client's [TopologyDescription](../server-discovery-and-monitoring/server-discovery-and-monitoring.rst#topologydescription) at a @@ -262,7 +262,7 @@ The top-level fields of a test file are as follows: This SHOULD describe the common purpose of tests in this file and MAY refer to the filename (e.g. "updateOne-hint"). -
+ - `schemaVersion`: Required string. Version of this specification with which the test file complies. @@ -274,13 +274,13 @@ The top-level fields of a test file are as follows: specific patch versions since patch-level changes SHOULD NOT alter the structure of the test format (as previously noted in [Schema Version](#schema-version)). -
+ - `runOnRequirements`: Optional array of one or more [runOnRequirement](#runonrequirement) objects. List of server version and/or topology requirements for which the tests in this file can be run. If no requirements are met, the test runner MUST skip this test file. -
+ - `createEntities`: Optional array of one or more [entity](#entity) objects. List of entities (e.g. client, collection, session objects) that SHALL be created before each test case is executed. @@ -288,12 +288,12 @@ The top-level fields of a test file are as follows: Test files SHOULD define entities in dependency order, such that all referenced entities (e.g. client) are defined before any of their dependent entities (e.g. database, session). -
+ - `initialData`: Optional array of one or more [collectionData](#collectiondata) objects. Data that will exist in collections before each test case is executed. -
+ - `tests`: Required array of one or more [test](#test) objects. List of test cases to be executed independently of each other. @@ -356,7 +356,7 @@ The structure of this object is as follows: parameter, test runners MUST treat the comparison as not equal and skip the test. This includes errors that occur when fetching a single parameter using `getParameter`. -
+ - `auth`: Optional boolean. If true, the tests MUST only run if authentication is enabled. If false, tests MUST NOT run if authentication is enabled. If this field is omitted, there is no authentication requirement. @@ -395,7 +395,7 @@ on the entity's `id` key. This anchor will allow the unique name to be reference The structure of this object is as follows: -
+ - `client`: Optional object. Defines a MongoClient object. In addition to the configuration defined below, test runners for drivers that implement connection pooling MUST track the number of connections checked out at any given time for @@ -425,7 +425,7 @@ The structure of this object is as follows: PROVIDER_NAME: { $$placeholder: 1 } ``` -
+ - `useMultipleMongoses`: Optional boolean. If true and the topology is a sharded cluster, the test runner MUST assert that this MongoClient connects to multiple mongos hosts (e.g. by inspecting the connection string). If false and the @@ -451,7 +451,7 @@ The structure of this object is as follows: This option has no effect for topologies that are not sharded or load balanced. -
+ - `observeEvents`: Optional array of one or more strings. Types of events that can be observed for this client. Unspecified event types MUST be ignored by this client's event listeners and SHOULD NOT be included in @@ -480,7 +480,7 @@ The structure of this object is as follows: - [serverHeartbeatFailedEvent](#expectedEvent_serverHeartbeatFailedEvent) - [topologyDescriptionChangedEvent](#expectedEvent_topologyDescriptionChangedEvent) -
+ - `ignoreCommandMonitoringEvents`: Optional array of one or more strings. Command names for which the test runner MUST ignore any observed command monitoring events. The command(s) will be ignored in addition to `configureFailPoint` @@ -491,7 +491,7 @@ The structure of this object is as follows: Test files SHOULD NOT use this option unless one or more command monitoring events are specified in [observeEvents](#entity_client_observeEvents). -
+ - `observeSensitiveCommands`: Optional boolean. If true, events associated with sensitive commands (per the [Command Logging and Monitoring](../command-logging-and-monitoring/command-logging-and-monitoring.rst#security) @@ -500,7 +500,7 @@ The structure of this object is as follows: ignored. Authentication SHOULD be disabled when this property is true, i.e. [auth](#runOnRequirement_auth) should be false for each `runOnRequirement`. See [rationale_observeSensitiveCommands](#rationale_observeSensitiveCommands). -
+ - `storeEventsAsEntities`: Optional array of one or more [storeEventsAsEntity](#storeeventsasentity) objects. Each object denotes an entity name and one or more events to be collected and stored in that entity. See @@ -517,7 +517,7 @@ The structure of this object is as follows: events: [PoolCreatedEvent, ConnectionCreatedEvent, CommandStartedEvent] ``` -
+ - `observeLogMessages`: Optional object where the key names are log [components](../logging/logging.md#components) and the values are minimum [log severity levels](../logging/logging.md#log-severity-levels) indicating which components @@ -526,7 +526,7 @@ The structure of this object is as follows: collector(s) and SHOULD NOT be included in [test.expectLogMessages](#test_expectLogMessages) for this client. - `serverApi`: Optional [serverApi](#serverapi) object. -
+ - `clientEncryption`: Optional object. Defines a ClientEncryption object. @@ -573,7 +573,7 @@ The structure of this object is as follows: See the [Client-Side Encryption test README](../client-side-encryption/tests/README.md#credentials) for instructions to obtain test credentials. -
+ - `database`: Optional object. Defines a Database object. @@ -589,7 +589,7 @@ The structure of this object is as follows: `databaseName: &database0Name foo`). - `databaseOptions`: Optional [collectionOrDatabaseOptions](#collectionordatabaseoptions) object. -
+ - `collection`: Optional object. Defines a Collection object. @@ -605,7 +605,7 @@ The structure of this object is as follows: `collectionName: &collection0Name foo`). - `collectionOptions`: Optional [collectionOrDatabaseOptions](#collectionordatabaseoptions) object. -
+ - `session`: Optional object. Defines an explicit ClientSession object. @@ -630,7 +630,7 @@ The structure of this object is as follows: When specifying TransactionOptions for `defaultTransactionOptions`, the transaction options MUST remain nested under `defaultTransactionOptions` and MUST NOT be flattened into `sessionOptions`. -
+ - `bucket`: Optional object. Defines a Bucket object, as defined in the [GridFS](../gridfs/gridfs-spec.md) spec. @@ -645,7 +645,7 @@ The structure of this object is as follows: defined in the [GridFS](../gridfs/gridfs-spec.md#configurable-gridfsbucket-class) specification. The `readConcern`, `readPreference`, and `writeConcern` options use the same structure as defined in [Common Options](#common-options). -
+ - `thread`: Optional object. Defines a test runner "thread". Once the "thread" has been created, it should be idle and waiting for operations to be dispatched to it later on by [runOnThread](#runonthread) operations. @@ -746,7 +746,7 @@ The structure of this object is as follows: This SHOULD describe the purpose of this test (e.g. "insertOne is retried"). -
+ - `runOnRequirements`: Optional array of one or more [runOnRequirement](#runonrequirement) objects. List of server version and/or topology requirements for which this test can be run. If specified, these requirements are evaluated @@ -758,17 +758,17 @@ The structure of this object is as follows: of requirements MUST be satisfied in order for a test to be executed and more permissive requirements at the test-level could be taken out of context on their own. -
+ - `skipReason`: Optional string. If set, the test will be skipped. The string SHOULD explain the reason for skipping the test (e.g. JIRA ticket). -
+ - `operations`: Required array of one or more [operation](#operation) objects. List of operations to be executed for the test case. -
+ - `expectEvents`: Optional array of one or more [expectedEventsForClient](#expectedeventsforclient) objects. For one or more clients, a list of events that are expected to be observed in a particular order. @@ -781,7 +781,7 @@ The structure of this object is as follows: [expectedEventsForClient](#expectedeventsforclient) objects with the `eventType` set to `cmap` for both would either be redundant (if the `events` arrays were identical) or likely to fail (if the `events` arrays differed). -
+ - `expectLogMessages`: Optional array of one or more [expectedLogMessagesForClient](#expectedlogmessagesforclient) objects. For one or more clients, a list of log messages that are expected to be observed in a particular order. @@ -794,7 +794,7 @@ The structure of this object is as follows: Tests SHOULD NOT specify multiple [expectedLogMessagesForClient](#expectedlogmessagesforclient) objects for a single client entity. -
+ - `outcome`: Optional array of one or more [collectionData](#collectiondata) objects. Data that is expected to exist in collections after each test case is executed. @@ -808,18 +808,18 @@ An operation to be executed as part of the test. The structure of this object is as follows: -
+ - `name`: Required string. Name of the operation (e.g. method) to perform on the object. -
+ - `object`: Required string. Name of the object on which to perform the operation. This SHOULD correspond to either an [entity](#entity) name (for [Entity Test Operations](#entity-test-operations)) or "testRunner" (for [Special Test Operations](#special-test-operations)). If the object is an entity, The YAML file SHOULD use an [alias node](https://yaml.org/spec/1.2/spec.html#id2786196) for its `id` field (e.g. `object: *collection0`). -
+ - `arguments`: Optional object. Map of parameter names and values for the operation. The structure of this object will vary based on the operation. See [Entity Test Operations](#entity-test-operations) and @@ -827,7 +827,7 @@ The structure of this object is as follows: The `session` parameter is handled specially (see [commonOptions_session](#commonOptions_session)). -
+ - `ignoreResultAndError`: Optional boolean. If true, both the error and result for the operation MUST be ignored. @@ -836,7 +836,7 @@ The structure of this object is as follows: This field SHOULD NOT be used for [Special Test Operations](#special-test-operations) (i.e. `object: testRunner`). -
+ - `expectError`: Optional [expectedError](#expectederror) object. One or more assertions for an error expected to be raised by the operation. @@ -846,7 +846,7 @@ The structure of this object is as follows: This field SHOULD NOT be used for [Special Test Operations](#special-test-operations) (i.e. `object: testRunner`). -
+ - `expectResult`: Optional mixed type. A value corresponding to the expected result of the operation. This field may be a scalar value, a single document, or an array of values. Test runners MUST follow the rules in @@ -856,7 +856,7 @@ The structure of this object is as follows: This field SHOULD NOT be used for [Special Test Operations](#special-test-operations) (i.e. `object: testRunner`). -
+ - `saveResultAsEntity`: Optional string. If specified, the actual result returned by the operation (if any) will be saved with this name in the [Entity Map](#entity-map). The test runner MUST raise an error if the name is already in @@ -923,7 +923,7 @@ The structure of this object is as follows: to have. The test runner MUST assert that the error does not contain any of the specified labels (e.g. using the `hasErrorLabel` method). -
+ - `errorResponse`: Optional document. A value corresponding to the expected server response. The test runner MUST assert that the error includes a server response that matches this value as a root-level document according to the rules in @@ -934,7 +934,7 @@ The structure of this object is as follows: may not provide direct access to a single response. Tests SHOULD avoid using `errorResponse` for such operations if possible; otherwise, affected drivers SHOULD skip such tests if necessary. -
+ - `expectResult`: Optional mixed type. This field follows the same rules as [operation.expectResult](#operation_expectResult) and is only used in cases where the error includes a result (e.g. @@ -985,7 +985,7 @@ The events allowed in an `expectedEvent` object depend on the value of `eventTyp The structure of this object is as follows: -
+ - `commandStartedEvent`: Optional object. Assertions for one or more [CommandStartedEvent](../command-logging-and-monitoring/command-logging-and-monitoring.rst#api) fields. @@ -1001,7 +1001,7 @@ The structure of this object is as follows: - `hasServiceId`: Defined in [hasServiceId](#hasserviceid). - `hasServerConnectionId`: Defined in [hasServerConnectionId](#hasserverconnectionid). -
+ - `commandSucceededEvent`: Optional object. Assertions for one or more [CommandSucceededEvent](../command-logging-and-monitoring/command-logging-and-monitoring.rst#api) fields. @@ -1017,7 +1017,7 @@ The structure of this object is as follows: - `hasServiceId`: Defined in [hasServiceId](#hasserviceid). - `hasServerConnectionId`: Defined in [hasServerConnectionId](#hasserverconnectionid). -
+ - `commandFailedEvent`: Optional object. Assertions for one or more [CommandFailedEvent](../command-logging-and-monitoring/command-logging-and-monitoring.rst#api) fields. @@ -1033,17 +1033,17 @@ The structure of this object is as follows: ##### expectedCmapEvent -
+ - `poolCreatedEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `poolReadyEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `poolClearedEvent`: Optional object. Assertions for one or more [PoolClearedEvent](../connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events) fields. @@ -1054,22 +1054,22 @@ The structure of this object is as follows: - `interruptInUseConnections`: Optional boolean. If specified, test runners MUST assert that the field is set and matches this value. -
+ - `poolClosedEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `connectionCreatedEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `connectionReadyEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `connectionClosedEvent`: Optional object. Assertions for one or more [ConnectionClosedEvent](../connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events) fields. @@ -1079,12 +1079,12 @@ The structure of this object is as follows: - `reason`: Optional string. Test runners MUST assert that the reason in the published event matches this value. Valid values for this field are defined in the CMAP spec. -
+ - `connectionCheckOutStartedEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `connectionCheckOutFailedEvent`: Optional object. Assertions for one or more [ConnectionCheckOutFailedEvent](../connection-monitoring-and-pooling/connection-monitoring-and-pooling.md#events) @@ -1095,12 +1095,12 @@ The structure of this object is as follows: - `reason`: Optional string. Test runners MUST assert that the reason in the published event matches this value. Valid values for this field are defined in the CMAP spec. -
+ - `connectionCheckedOutEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. -
+ - `connectionCheckedInEvent`: Optional object. If present, this object MUST be an empty document as all fields in this event are non-deterministic. @@ -1109,7 +1109,7 @@ The structure of this object is as follows: The structure of this object is as follows: -
+ - `serverDescriptionChangedEvent`: Optional object. Assertions for one or more [ServerDescriptionChangedEvent](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events) @@ -1130,7 +1130,7 @@ The structure of this object is as follows: [SDAM: ServerType](../server-discovery-and-monitoring/server-discovery-and-monitoring.rst#servertype) for a list of valid values. -
+ - `serverHeartbeatStartedEvent`: Optional object. Assertions for one or more [ServerHeartbeatStartedEvent](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events) @@ -1140,7 +1140,7 @@ The structure of this object is as follows: - `awaited`: Optional boolean. If specified, test runners MUST assert that the field is set and matches this value. -
+ - `serverHeartbeatSucceededEvent`: Optional object. Assertions for one or more [ServerHeartbeatSucceededEvent](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events) @@ -1150,7 +1150,7 @@ The structure of this object is as follows: - `awaited`: Optional boolean. If specified, test runners MUST assert that the field is set and matches this value. -
+ - `serverHeartbeatFailedEvent`: Optional object. Assertions for one or more [ServerHeartbeatFailedEvent](../server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events) @@ -1160,7 +1160,7 @@ The structure of this object is as follows: - `awaited`: Optional boolean. If specified, test runners MUST assert that the field is set and matches this value. -
+ - `topologyDescriptionChangedEvent`: Optional object. If present, this object MUST be an empty document as no assertions are currently supported for @@ -1268,19 +1268,19 @@ Comprehensive documentation for some of these types and their parameters may be The structure of these common options is as follows: -
+ - `collectionName`: String. Collection name. The YAML file SHOULD use an [alias node](https://yaml.org/spec/1.2/spec.html#id2786196) for a collection entity's `collectionName` field (e.g. `collectionName: *collection0Name`). -
+ - `databaseName`: String. Database name. The YAML file SHOULD use an [alias node](https://yaml.org/spec/1.2/spec.html#id2786196) for a database entity's `databaseName` field (e.g. `databaseName: *database0Name`). -
+ - `readConcern`: Object. Map of parameters to construct a read concern. @@ -1288,7 +1288,7 @@ The structure of these common options is as follows: - `level`: Required string. -
+ - `readPreference`: Object. Map of parameters to construct a read preference. @@ -1299,19 +1299,19 @@ The structure of these common options is as follows: - `maxStalenessSeconds`: Optional integer. - `hedge`: Optional object. -
+ - `client`: String. Client entity name, which the test runner MUST resolve to a MongoClient object. The YAML file SHOULD use an [alias node](https://yaml.org/spec/1.2/spec.html#id2786196) for a client entity's `id` field (e.g. `client: *client0`). -
+ - `session`: String. Session entity name, which the test runner MUST resolve to a ClientSession object. The YAML file SHOULD use an [alias node](https://yaml.org/spec/1.2/spec.html#id2786196) for a session entity's `id` field (e.g. `session: *session0`). -
+ - `writeConcern`: Object. Map of parameters to construct a write concern. @@ -1402,7 +1402,7 @@ Because drivers do not consistently propagate errors encountered while closing a NOT specify any operations for a client entity or any entity descended from it following a `close` operation on it, as driver behavior when an operation is attempted on a closed client or one of its descendant objects is not consistent. -
+ #### createChangeStream @@ -1460,7 +1460,7 @@ below. When executing an `aggregate` operation, the test runner MUST fully iterate the result. This will ensure consistent behavior between drivers that eagerly create a server-side cursor and those that do so lazily when iteration begins. -
+ #### createChangeStream @@ -1553,7 +1553,7 @@ These operations and their arguments may be documented in the following specific Collection operations that require special handling or are not documented by an existing specification are described below. -
+ #### aggregate @@ -1609,7 +1609,7 @@ BulkWriteException MAY translate the expected code name to a number (see: instead, but MUST raise an error if the comparison cannot be attempted (e.g. `code` is also not available, translation fails). -
+ #### createChangeStream @@ -1623,7 +1623,7 @@ before the resulting change stream might be saved with [operation.saveResultAsEn Test runners MUST NOT iterate the change stream when executing this operation and test files SHOULD NOT specify [operation.expectResult](#operation_expectResult) for this operation. -
+ #### createFindCursor @@ -1729,8 +1729,8 @@ These operations and their arguments may be documented in the following specific Bucket operations that require special handling or are not documented by an existing specification are described below. -
-
+ + #### download and downloadByName @@ -1749,12 +1749,14 @@ These operations SHOULD NOT be used in test files. See These operations SHOULD NOT be used in test files. See [download and downloadByName](#download-and-downloadbyname). -#### openUploadStream and openUploadStreamWithId\` + + +#### openUploadStream and openUploadStreamWithId These operations SHOULD NOT be used in test files. See [IO operations for GridFS streams](#io-operations-for-gridfs-streams) in [Future Work](#future-work). -
+ #### upload and uploadWithId @@ -2150,7 +2152,7 @@ An example of this operation follows: Use a `listIndexes` command to check whether the index exists. Note that it is currently not possible to run `listIndexes` from within a transaction. -
+ #### createEntities @@ -3119,6 +3121,8 @@ impossible to guarantee that an existing transaction will not block test executi SHOULD either ignore Unauthorized(13) command failures or avoid calling `killAllSessions` altogether when connected to Atlas (e.g. by detecting `mongodb.net` in the hostname or allowing the test runner to be configured externally). +Test runners MUST NOT execute `killAllSessions` when connected to Atlas Data Lake. + ##### MigrationConflict Errors on Sharded Clusters Following [SERVER-82353](https://jira.mongodb.org/browse/SERVER-82353), drivers may encounter MigrationConflict errors @@ -3317,7 +3321,7 @@ ignored in order to test the test runner implementation (e.g. defining entities The specification does prefer "MUST" in other contexts, such as discussing parts of the test file format that *are* enforceable by the JSON schema or the test runner implementation. -
+ ### Why can't `observeSensitiveCommands` be true when authentication is enabled? @@ -3391,6 +3395,8 @@ other specs *and* collating spec changes developed in parallel or during the sam ## Changelog +- 2024-03-11: Note that `killAllSessions` should not be executed on Atlas Data Lake + - 2024-02-27: Document `onPrimaryTransactionalWrite` fail point, which is used in retryable writes tests. - 2024-02-23: Require test runners to gossip cluster time from internal MongoClient to each session entity. diff --git a/source/uri-options/uri-options.rst b/source/uri-options/uri-options.rst index 918d25bc08..4177a1c2dd 100644 --- a/source/uri-options/uri-options.rst +++ b/source/uri-options/uri-options.rst @@ -81,7 +81,7 @@ Load Balancer Mode For URI option validation in Load Balancer mode (i.e. ``loadBalanced=true``), please see the -`Load Balancer spec <../load-balancers/load-balancers.rst#uri-validation>`_ for +`Load Balancer spec <../load-balancers/load-balancers.md#uri-validation>`_ for details. @@ -186,7 +186,7 @@ pertaining to URI options apply here. * - loadBalanced - "true" or "false" - - defined in `Load Balancer spec <../load-balancers/load-balancers.rst#loadbalanced>`__ + - defined in `Load Balancer spec <../load-balancers/load-balancers.md#loadbalanced>`__ - no - Whether the driver is connecting to a load balancer.