From 939f1176cf1485881662619c25e206d83a0a884c Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 22 Oct 2024 18:58:16 -0400 Subject: [PATCH 1/5] skip tests expecting an `errorCodeName` on serverless Serverless may set an empty `codeName` due to CLOUDP-280424 --- .../tests/unified/commit-retry.yml | 3 +++ .../tests/unified/commit-writeconcernerror.yml | 9 +++++++++ source/transactions/tests/unified/abort.yml | 3 +++ source/transactions/tests/unified/count.yml | 3 +++ source/transactions/tests/unified/errors.yml | 6 ++++++ source/transactions/tests/unified/retryable-commit.yml | 3 +++ 6 files changed, 27 insertions(+) diff --git a/source/transactions-convenient-api/tests/unified/commit-retry.yml b/source/transactions-convenient-api/tests/unified/commit-retry.yml index 22d2125485..63ff0f30be 100644 --- a/source/transactions-convenient-api/tests/unified/commit-retry.yml +++ b/source/transactions-convenient-api/tests/unified/commit-retry.yml @@ -212,6 +212,9 @@ tests: - { _id: 1 } - description: commit is not retried after MaxTimeMSExpired error + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - name: failPoint object: testRunner diff --git a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml index 44877fa008..86bc467b0b 100644 --- a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml +++ b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml @@ -151,6 +151,9 @@ tests: outcome: *outcome - description: commitTransaction is not retried after UnknownReplWriteConcern error + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - name: failPoint object: testRunner @@ -203,6 +206,9 @@ tests: outcome: *outcome - description: commitTransaction is not retried after UnsatisfiableWriteConcern error + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - name: failPoint object: testRunner @@ -226,6 +232,9 @@ tests: outcome: *outcome - description: commitTransaction is not retried after MaxTimeMSExpired error + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - name: failPoint object: testRunner diff --git a/source/transactions/tests/unified/abort.yml b/source/transactions/tests/unified/abort.yml index 194846c92f..d961981a74 100644 --- a/source/transactions/tests/unified/abort.yml +++ b/source/transactions/tests/unified/abort.yml @@ -348,6 +348,9 @@ tests: - { _id: 1 } - description: 'abort ignores TransactionAborted' + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - object: *session0 diff --git a/source/transactions/tests/unified/count.yml b/source/transactions/tests/unified/count.yml index c78d5b2ae3..67a10d500e 100644 --- a/source/transactions/tests/unified/count.yml +++ b/source/transactions/tests/unified/count.yml @@ -49,6 +49,9 @@ initialData: tests: - description: count + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - object: *session0 diff --git a/source/transactions/tests/unified/errors.yml b/source/transactions/tests/unified/errors.yml index ce6ecfcff7..fc8153a38e 100644 --- a/source/transactions/tests/unified/errors.yml +++ b/source/transactions/tests/unified/errors.yml @@ -110,6 +110,9 @@ tests: errorContains: 'transaction already in progress' - description: 'write conflict commit' + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - object: *session0 @@ -151,6 +154,9 @@ tests: - UnknownTransactionCommitResult - description: 'write conflict abort' + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - object: *session0 diff --git a/source/transactions/tests/unified/retryable-commit.yml b/source/transactions/tests/unified/retryable-commit.yml index 916944065a..ed0f64978d 100644 --- a/source/transactions/tests/unified/retryable-commit.yml +++ b/source/transactions/tests/unified/retryable-commit.yml @@ -67,6 +67,9 @@ initialData: tests: - description: 'commitTransaction fails after Interrupted' + runOnRequirements: + # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. + - serverless: forbid operations: - object: testRunner From a0d62b97554ddb43bf8ec57f0fe5d5db59202419 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 22 Oct 2024 18:58:35 -0400 Subject: [PATCH 2/5] regenerate JSON files --- .../tests/unified/commit-retry.json | 5 +++++ .../tests/unified/commit-writeconcernerror.json | 15 +++++++++++++++ source/transactions/tests/unified/abort.json | 5 +++++ source/transactions/tests/unified/count.json | 5 +++++ source/transactions/tests/unified/errors.json | 10 ++++++++++ .../tests/unified/retryable-commit.json | 5 +++++ 6 files changed, 45 insertions(+) diff --git a/source/transactions-convenient-api/tests/unified/commit-retry.json b/source/transactions-convenient-api/tests/unified/commit-retry.json index 928f0167e4..cc80201167 100644 --- a/source/transactions-convenient-api/tests/unified/commit-retry.json +++ b/source/transactions-convenient-api/tests/unified/commit-retry.json @@ -422,6 +422,11 @@ }, { "description": "commit is not retried after MaxTimeMSExpired error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "name": "failPoint", diff --git a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json index a6f6e6bd7f..2f8acb5bf4 100644 --- a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json +++ b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json @@ -414,6 +414,11 @@ }, { "description": "commitTransaction is not retried after UnknownReplWriteConcern error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "name": "failPoint", @@ -546,6 +551,11 @@ }, { "description": "commitTransaction is not retried after UnsatisfiableWriteConcern error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "name": "failPoint", @@ -678,6 +688,11 @@ }, { "description": "commitTransaction is not retried after MaxTimeMSExpired error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "name": "failPoint", diff --git a/source/transactions/tests/unified/abort.json b/source/transactions/tests/unified/abort.json index c151a7d0c6..abc5f7ce37 100644 --- a/source/transactions/tests/unified/abort.json +++ b/source/transactions/tests/unified/abort.json @@ -591,6 +591,11 @@ }, { "description": "abort ignores TransactionAborted", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/count.json b/source/transactions/tests/unified/count.json index 404b06beb6..df012a04f1 100644 --- a/source/transactions/tests/unified/count.json +++ b/source/transactions/tests/unified/count.json @@ -70,6 +70,11 @@ "tests": [ { "description": "count", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/errors.json b/source/transactions/tests/unified/errors.json index 94a9cac207..ae0413392a 100644 --- a/source/transactions/tests/unified/errors.json +++ b/source/transactions/tests/unified/errors.json @@ -160,6 +160,11 @@ }, { "description": "write conflict commit", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "object": "session0", @@ -226,6 +231,11 @@ }, { "description": "write conflict abort", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/retryable-commit.json b/source/transactions/tests/unified/retryable-commit.json index b794c1c55c..7d7e52495d 100644 --- a/source/transactions/tests/unified/retryable-commit.json +++ b/source/transactions/tests/unified/retryable-commit.json @@ -89,6 +89,11 @@ "tests": [ { "description": "commitTransaction fails after Interrupted", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], "operations": [ { "object": "testRunner", From 9272902aa40d6ddefe17b54393f48543cde245b3 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 29 Oct 2024 13:35:37 -0400 Subject: [PATCH 3/5] use schema version 1.4 for `serverless` in `runOnRequirements` --- .../tests/unified/commit-writeconcernerror.yml | 2 +- source/transactions/tests/unified/abort.yml | 2 +- source/transactions/tests/unified/count.yml | 4 ++-- source/transactions/tests/unified/errors.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml index 86bc467b0b..a4a80839a3 100644 --- a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml +++ b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml @@ -1,6 +1,6 @@ description: commit-writeconcernerror -schemaVersion: '1.3' +schemaVersion: '1.4' # For `serverless` in `runOnRequirements` runOnRequirements: - minServerVersion: '4.0' diff --git a/source/transactions/tests/unified/abort.yml b/source/transactions/tests/unified/abort.yml index d961981a74..255eca863d 100644 --- a/source/transactions/tests/unified/abort.yml +++ b/source/transactions/tests/unified/abort.yml @@ -1,6 +1,6 @@ description: abort -schemaVersion: '1.3' +schemaVersion: '1.4' # For `serverless` in `runOnRequirements` runOnRequirements: - diff --git a/source/transactions/tests/unified/count.yml b/source/transactions/tests/unified/count.yml index 67a10d500e..82832521c3 100644 --- a/source/transactions/tests/unified/count.yml +++ b/source/transactions/tests/unified/count.yml @@ -1,6 +1,6 @@ description: count -schemaVersion: '1.3' +schemaVersion: '1.4' # For `serverless` in `runOnRequirements` runOnRequirements: # SERVER-35388 introduced OperationNotSupportedInTransaction in 4.0.2 @@ -102,4 +102,4 @@ tests: - collectionName: *collection_name databaseName: *database_name - documents: *data \ No newline at end of file + documents: *data diff --git a/source/transactions/tests/unified/errors.yml b/source/transactions/tests/unified/errors.yml index fc8153a38e..a01d11fa83 100644 --- a/source/transactions/tests/unified/errors.yml +++ b/source/transactions/tests/unified/errors.yml @@ -1,6 +1,6 @@ description: errors -schemaVersion: '1.3' +schemaVersion: '1.4' # For `serverless` in `runOnRequirements` runOnRequirements: - From 5149d9830877a7358d8b216d77d5f6f3852548c7 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Tue, 29 Oct 2024 13:37:50 -0400 Subject: [PATCH 4/5] regenerate JSON files --- .../tests/unified/commit-writeconcernerror.json | 2 +- source/transactions/tests/unified/abort.json | 2 +- source/transactions/tests/unified/count.json | 2 +- source/transactions/tests/unified/errors.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json index 2f8acb5bf4..a455a450bf 100644 --- a/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json +++ b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json @@ -1,6 +1,6 @@ { "description": "commit-writeconcernerror", - "schemaVersion": "1.3", + "schemaVersion": "1.4", "runOnRequirements": [ { "minServerVersion": "4.0", diff --git a/source/transactions/tests/unified/abort.json b/source/transactions/tests/unified/abort.json index abc5f7ce37..108899db52 100644 --- a/source/transactions/tests/unified/abort.json +++ b/source/transactions/tests/unified/abort.json @@ -1,6 +1,6 @@ { "description": "abort", - "schemaVersion": "1.3", + "schemaVersion": "1.4", "runOnRequirements": [ { "minServerVersion": "4.0", diff --git a/source/transactions/tests/unified/count.json b/source/transactions/tests/unified/count.json index df012a04f1..a4cd884e17 100644 --- a/source/transactions/tests/unified/count.json +++ b/source/transactions/tests/unified/count.json @@ -1,6 +1,6 @@ { "description": "count", - "schemaVersion": "1.3", + "schemaVersion": "1.4", "runOnRequirements": [ { "minServerVersion": "4.0.2", diff --git a/source/transactions/tests/unified/errors.json b/source/transactions/tests/unified/errors.json index ae0413392a..cbebf5fa50 100644 --- a/source/transactions/tests/unified/errors.json +++ b/source/transactions/tests/unified/errors.json @@ -1,6 +1,6 @@ { "description": "errors", - "schemaVersion": "1.3", + "schemaVersion": "1.4", "runOnRequirements": [ { "minServerVersion": "4.0", From b93a45458e1b5366538f76831bd48debab9e0384 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Wed, 30 Oct 2024 14:35:28 -0400 Subject: [PATCH 5/5] revert unnecessary skips --- source/transactions/tests/unified/abort.json | 7 +------ source/transactions/tests/unified/abort.yml | 5 +---- source/transactions/tests/unified/count.json | 7 +------ source/transactions/tests/unified/count.yml | 7 ++----- source/transactions/tests/unified/errors.json | 12 +----------- source/transactions/tests/unified/errors.yml | 8 +------- 6 files changed, 7 insertions(+), 39 deletions(-) diff --git a/source/transactions/tests/unified/abort.json b/source/transactions/tests/unified/abort.json index 108899db52..c151a7d0c6 100644 --- a/source/transactions/tests/unified/abort.json +++ b/source/transactions/tests/unified/abort.json @@ -1,6 +1,6 @@ { "description": "abort", - "schemaVersion": "1.4", + "schemaVersion": "1.3", "runOnRequirements": [ { "minServerVersion": "4.0", @@ -591,11 +591,6 @@ }, { "description": "abort ignores TransactionAborted", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/abort.yml b/source/transactions/tests/unified/abort.yml index 255eca863d..194846c92f 100644 --- a/source/transactions/tests/unified/abort.yml +++ b/source/transactions/tests/unified/abort.yml @@ -1,6 +1,6 @@ description: abort -schemaVersion: '1.4' # For `serverless` in `runOnRequirements` +schemaVersion: '1.3' runOnRequirements: - @@ -348,9 +348,6 @@ tests: - { _id: 1 } - description: 'abort ignores TransactionAborted' - runOnRequirements: - # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. - - serverless: forbid operations: - object: *session0 diff --git a/source/transactions/tests/unified/count.json b/source/transactions/tests/unified/count.json index a4cd884e17..404b06beb6 100644 --- a/source/transactions/tests/unified/count.json +++ b/source/transactions/tests/unified/count.json @@ -1,6 +1,6 @@ { "description": "count", - "schemaVersion": "1.4", + "schemaVersion": "1.3", "runOnRequirements": [ { "minServerVersion": "4.0.2", @@ -70,11 +70,6 @@ "tests": [ { "description": "count", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/count.yml b/source/transactions/tests/unified/count.yml index 82832521c3..c78d5b2ae3 100644 --- a/source/transactions/tests/unified/count.yml +++ b/source/transactions/tests/unified/count.yml @@ -1,6 +1,6 @@ description: count -schemaVersion: '1.4' # For `serverless` in `runOnRequirements` +schemaVersion: '1.3' runOnRequirements: # SERVER-35388 introduced OperationNotSupportedInTransaction in 4.0.2 @@ -49,9 +49,6 @@ initialData: tests: - description: count - runOnRequirements: - # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. - - serverless: forbid operations: - object: *session0 @@ -102,4 +99,4 @@ tests: - collectionName: *collection_name databaseName: *database_name - documents: *data + documents: *data \ No newline at end of file diff --git a/source/transactions/tests/unified/errors.json b/source/transactions/tests/unified/errors.json index cbebf5fa50..94a9cac207 100644 --- a/source/transactions/tests/unified/errors.json +++ b/source/transactions/tests/unified/errors.json @@ -1,6 +1,6 @@ { "description": "errors", - "schemaVersion": "1.4", + "schemaVersion": "1.3", "runOnRequirements": [ { "minServerVersion": "4.0", @@ -160,11 +160,6 @@ }, { "description": "write conflict commit", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], "operations": [ { "object": "session0", @@ -231,11 +226,6 @@ }, { "description": "write conflict abort", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], "operations": [ { "object": "session0", diff --git a/source/transactions/tests/unified/errors.yml b/source/transactions/tests/unified/errors.yml index a01d11fa83..ce6ecfcff7 100644 --- a/source/transactions/tests/unified/errors.yml +++ b/source/transactions/tests/unified/errors.yml @@ -1,6 +1,6 @@ description: errors -schemaVersion: '1.4' # For `serverless` in `runOnRequirements` +schemaVersion: '1.3' runOnRequirements: - @@ -110,9 +110,6 @@ tests: errorContains: 'transaction already in progress' - description: 'write conflict commit' - runOnRequirements: - # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. - - serverless: forbid operations: - object: *session0 @@ -154,9 +151,6 @@ tests: - UnknownTransactionCommitResult - description: 'write conflict abort' - runOnRequirements: - # Serverless sets empty `codeName` on failpoint errors. Remove once CLOUDP-280424 is fixed. - - serverless: forbid operations: - object: *session0