From 5f6fd2830847e5f311e7e56ba74db7aa87810fa6 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Thu, 31 Oct 2024 11:23:35 -0400 Subject: [PATCH] DRIVERS-3021 Skip tests with `errorCodeName` on Serverless (#1680) Skip tests on Atlas Serverless that expect a `codeName` from an error caused by a failpoint. Serverless may set an empty `codeName` due to CLOUDP-280424 --- .../tests/unified/commit-retry.json | 5 +++++ .../tests/unified/commit-retry.yml | 3 +++ .../tests/unified/commit-writeconcernerror.json | 17 ++++++++++++++++- .../tests/unified/commit-writeconcernerror.yml | 11 ++++++++++- .../tests/unified/retryable-commit.json | 5 +++++ .../tests/unified/retryable-commit.yml | 3 +++ 6 files changed, 42 insertions(+), 2 deletions(-) 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-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.json b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.json index a6f6e6bd7f..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", @@ -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-convenient-api/tests/unified/commit-writeconcernerror.yml b/source/transactions-convenient-api/tests/unified/commit-writeconcernerror.yml index 44877fa008..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' @@ -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/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", 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