From 9f98eb5024e133339f32216409824f9d67bf171a Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 12 Feb 2024 20:23:56 -0500 Subject: [PATCH] PHPLIB-1397: Update tests for skipping LB topologies for targetedFailPoint --- tests/UnifiedSpecTests/UnifiedSpecTest.php | 62 ------------------- .../transactions/mongos-pin-auto.json | 3 +- .../mongos-recovery-token-errorLabels.json | 3 +- .../transactions/mongos-recovery-token.json | 14 +++++ .../transactions/mongos-unpin.json | 17 ++++- .../transactions/pin-mongos.json | 21 +++++++ .../transactions/read-pref.json | 10 +-- .../transactions/run-command.json | 8 +-- 8 files changed, 61 insertions(+), 77 deletions(-) diff --git a/tests/UnifiedSpecTests/UnifiedSpecTest.php b/tests/UnifiedSpecTests/UnifiedSpecTest.php index 5ac85e093..1931c376f 100644 --- a/tests/UnifiedSpecTests/UnifiedSpecTest.php +++ b/tests/UnifiedSpecTests/UnifiedSpecTest.php @@ -99,70 +99,8 @@ class UnifiedSpecTest extends FunctionalTestCase * Any tests that rely on session pinning (including targetedFailPoint) must * be skipped since libmongoc does not pin on load-balanced toplogies. */ private static array $incompleteLoadBalancerTests = [ - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on insertOne' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient error within a transaction' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on insertOne insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on insertMany insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on updateOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on replaceOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on updateMany update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on deleteOne delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on deleteMany delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on bulkWrite insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on bulkWrite update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on bulkWrite delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on find find' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on countDocuments aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on aggregate aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on distinct distinct' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: remain pinned after non-transient Interrupted error on runCommand insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on insertOne insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on insertOne insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on insertMany insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on insertMany insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on updateOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on updateOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on replaceOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on replaceOne update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on updateMany update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on updateMany update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on deleteOne delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on deleteOne delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on deleteMany delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on deleteMany delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on findOneAndDelete findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on findOneAndUpdate findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on findOneAndReplace findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on bulkWrite insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on bulkWrite insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on bulkWrite update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on bulkWrite update' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on bulkWrite delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on bulkWrite delete' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on find find' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on find find' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on countDocuments aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on countDocuments aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on aggregate aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on aggregate aggregate' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on distinct distinct' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on distinct distinct' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient connection error on runCommand insert' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-pin-auto: unpin after transient ShutdownInProgress error on runCommand insert' => 'libmongoc does not pin for load-balanced topology', 'transactions/mongos-recovery-token: commitTransaction explicit retries include recoveryToken' => 'libmongoc omits recoveryToken for load-balanced topology (CDRIVER-4718)', - 'transactions/mongos-recovery-token: commitTransaction retry fails on new mongos' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-recovery-token: abortTransaction sends recoveryToken' => 'libmongoc does not pin for load-balanced topology', - 'transactions/mongos-recovery-token-errorLabels: commitTransaction retry succeeds on new mongos' => 'libmongoc does not pin for load-balanced topology', 'transactions/pin-mongos: multiple commits' => 'libmongoc does not pin for load-balanced topology', - 'transactions/pin-mongos: remain pinned after non-transient error on commit' => 'libmongoc does not pin for load-balanced topology', - 'transactions/pin-mongos: unpin after transient error within a transaction' => 'libmongoc does not pin for load-balanced topology', - 'transactions/pin-mongos: unpin after transient error within a transaction and commit' => 'libmongoc does not pin for load-balanced topology', ]; private static UnifiedTestRunner $runner; diff --git a/tests/UnifiedSpecTests/transactions/mongos-pin-auto.json b/tests/UnifiedSpecTests/transactions/mongos-pin-auto.json index be685ea83..93eac8bb7 100644 --- a/tests/UnifiedSpecTests/transactions/mongos-pin-auto.json +++ b/tests/UnifiedSpecTests/transactions/mongos-pin-auto.json @@ -5,8 +5,7 @@ { "minServerVersion": "4.1.8", "topologies": [ - "sharded", - "load-balanced" + "sharded" ], "serverless": "forbid" } diff --git a/tests/UnifiedSpecTests/transactions/mongos-recovery-token-errorLabels.json b/tests/UnifiedSpecTests/transactions/mongos-recovery-token-errorLabels.json index fd7a82993..13345c6a2 100644 --- a/tests/UnifiedSpecTests/transactions/mongos-recovery-token-errorLabels.json +++ b/tests/UnifiedSpecTests/transactions/mongos-recovery-token-errorLabels.json @@ -6,8 +6,7 @@ "minServerVersion": "4.3.1", "serverless": "forbid", "topologies": [ - "sharded", - "load-balanced" + "sharded" ] } ], diff --git a/tests/UnifiedSpecTests/transactions/mongos-recovery-token.json b/tests/UnifiedSpecTests/transactions/mongos-recovery-token.json index ae1c1a91f..00909c421 100644 --- a/tests/UnifiedSpecTests/transactions/mongos-recovery-token.json +++ b/tests/UnifiedSpecTests/transactions/mongos-recovery-token.json @@ -214,6 +214,13 @@ }, { "description": "commitTransaction retry fails on new mongos", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "object": "testRunner", @@ -408,6 +415,13 @@ }, { "description": "abortTransaction sends recoveryToken", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "object": "session0", diff --git a/tests/UnifiedSpecTests/transactions/mongos-unpin.json b/tests/UnifiedSpecTests/transactions/mongos-unpin.json index 356f4fd9b..4d1ebc87b 100644 --- a/tests/UnifiedSpecTests/transactions/mongos-unpin.json +++ b/tests/UnifiedSpecTests/transactions/mongos-unpin.json @@ -52,7 +52,10 @@ "description": "unpin after TransientTransactionError error on commit", "runOnRequirements": [ { - "serverless": "forbid" + "serverless": "forbid", + "topologies": [ + "sharded" + ] } ], "operations": [ @@ -163,7 +166,10 @@ "description": "unpin after non-transient error on abort", "runOnRequirements": [ { - "serverless": "forbid" + "serverless": "forbid", + "topologies": [ + "sharded" + ] } ], "operations": [ @@ -233,6 +239,13 @@ }, { "description": "unpin after TransientTransactionError error on abort", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "name": "startTransaction", diff --git a/tests/UnifiedSpecTests/transactions/pin-mongos.json b/tests/UnifiedSpecTests/transactions/pin-mongos.json index fe268cd5f..5f2ecca5c 100644 --- a/tests/UnifiedSpecTests/transactions/pin-mongos.json +++ b/tests/UnifiedSpecTests/transactions/pin-mongos.json @@ -936,6 +936,13 @@ }, { "description": "remain pinned after non-transient error on commit", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "object": "session0", @@ -1044,6 +1051,13 @@ }, { "description": "unpin after transient error within a transaction", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "object": "session0", @@ -1217,6 +1231,13 @@ }, { "description": "unpin after transient error within a transaction and commit", + "runOnRequirements": [ + { + "topologies": [ + "sharded" + ] + } + ], "operations": [ { "object": "testRunner", diff --git a/tests/UnifiedSpecTests/transactions/read-pref.json b/tests/UnifiedSpecTests/transactions/read-pref.json index 2c20252ed..eda00bd10 100644 --- a/tests/UnifiedSpecTests/transactions/read-pref.json +++ b/tests/UnifiedSpecTests/transactions/read-pref.json @@ -217,7 +217,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Primary" + "mode": "primary" } } }, @@ -362,7 +362,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Secondary" + "mode": "secondary" } } }, @@ -470,7 +470,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "PrimaryPreferred" + "mode": "primaryPreferred" } } }, @@ -578,7 +578,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Nearest" + "mode": "nearest" } } }, @@ -686,7 +686,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Secondary" + "mode": "secondary" } } }, diff --git a/tests/UnifiedSpecTests/transactions/run-command.json b/tests/UnifiedSpecTests/transactions/run-command.json index 1d506fe9c..7bd420ef7 100644 --- a/tests/UnifiedSpecTests/transactions/run-command.json +++ b/tests/UnifiedSpecTests/transactions/run-command.json @@ -185,7 +185,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Primary" + "mode": "primary" } } }, @@ -292,7 +292,7 @@ ] }, "readPreference": { - "mode": "Primary" + "mode": "primary" }, "commandName": "insert" }, @@ -379,7 +379,7 @@ "find": "test" }, "readPreference": { - "mode": "Secondary" + "mode": "secondary" }, "commandName": "find" }, @@ -397,7 +397,7 @@ "name": "startTransaction", "arguments": { "readPreference": { - "mode": "Secondary" + "mode": "secondary" } } },