From 489e05b62d5e66e42eb361855feaaeaff49e4810 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 9 Feb 2022 16:55:45 -0500 Subject: [PATCH] test(NODE-3733): Make retryable write test error labels behave consistently with server (#3140) --- .../retryable_writes.spec.test.js | 4 +- .../retryable-writes/{ => legacy}/README.rst | 0 .../{ => legacy}/bulkWrite-errorLabels.json | 0 .../{ => legacy}/bulkWrite-errorLabels.yml | 0 .../{ => legacy}/bulkWrite-serverErrors.json | 8 ++-- .../{ => legacy}/bulkWrite-serverErrors.yml | 2 +- .../{ => legacy}/bulkWrite.json | 0 .../{ => legacy}/bulkWrite.yml | 0 .../{ => legacy}/deleteMany.json | 0 .../{ => legacy}/deleteMany.yml | 0 .../{ => legacy}/deleteOne-errorLabels.json | 0 .../{ => legacy}/deleteOne-errorLabels.yml | 0 .../{ => legacy}/deleteOne-serverErrors.json | 8 ++-- .../{ => legacy}/deleteOne-serverErrors.yml | 2 +- .../{ => legacy}/deleteOne.json | 0 .../{ => legacy}/deleteOne.yml | 0 .../findOneAndDelete-errorLabels.json | 0 .../findOneAndDelete-errorLabels.yml | 0 .../findOneAndDelete-serverErrors.json | 8 ++-- .../findOneAndDelete-serverErrors.yml | 2 +- .../{ => legacy}/findOneAndDelete.json | 0 .../{ => legacy}/findOneAndDelete.yml | 0 .../findOneAndReplace-errorLabels.json | 0 .../findOneAndReplace-errorLabels.yml | 0 .../findOneAndReplace-serverErrors.json | 8 ++-- .../findOneAndReplace-serverErrors.yml | 2 +- .../{ => legacy}/findOneAndReplace.json | 0 .../{ => legacy}/findOneAndReplace.yml | 0 .../findOneAndUpdate-errorLabels.json | 0 .../findOneAndUpdate-errorLabels.yml | 0 .../findOneAndUpdate-serverErrors.json | 8 ++-- .../findOneAndUpdate-serverErrors.yml | 2 +- .../{ => legacy}/findOneAndUpdate.json | 0 .../{ => legacy}/findOneAndUpdate.yml | 0 .../{ => legacy}/insertMany-errorLabels.json | 0 .../{ => legacy}/insertMany-errorLabels.yml | 0 .../{ => legacy}/insertMany-serverErrors.json | 8 ++-- .../{ => legacy}/insertMany-serverErrors.yml | 2 +- .../{ => legacy}/insertMany.json | 0 .../{ => legacy}/insertMany.yml | 0 .../{ => legacy}/insertOne-errorLabels.json | 0 .../{ => legacy}/insertOne-errorLabels.yml | 0 .../{ => legacy}/insertOne-serverErrors.json | 40 +++++++++---------- .../{ => legacy}/insertOne-serverErrors.yml | 10 ++--- .../{ => legacy}/insertOne.json | 0 .../{ => legacy}/insertOne.yml | 0 .../{ => legacy}/replaceOne-errorLabels.json | 0 .../{ => legacy}/replaceOne-errorLabels.yml | 0 .../{ => legacy}/replaceOne-serverErrors.json | 8 ++-- .../{ => legacy}/replaceOne-serverErrors.yml | 2 +- .../{ => legacy}/replaceOne.json | 0 .../{ => legacy}/replaceOne.yml | 0 .../{ => legacy}/updateMany.json | 0 .../{ => legacy}/updateMany.yml | 0 .../{ => legacy}/updateOne-errorLabels.json | 0 .../{ => legacy}/updateOne-errorLabels.yml | 0 .../{ => legacy}/updateOne-serverErrors.json | 8 ++-- .../{ => legacy}/updateOne-serverErrors.yml | 2 +- .../{ => legacy}/updateOne.json | 0 .../{ => legacy}/updateOne.yml | 0 test/spec/retryable-writes/unified/.gitkeep | 0 .../transactions/legacy/error-labels.json | 8 ++-- .../spec/transactions/legacy/error-labels.yml | 2 +- .../legacy/mongos-recovery-token.json | 8 ++-- .../legacy/mongos-recovery-token.yml | 2 +- .../transactions/legacy/retryable-abort.json | 24 +++++------ .../transactions/legacy/retryable-abort.yml | 8 ++-- .../transactions/legacy/retryable-commit.json | 24 +++++------ .../transactions/legacy/retryable-commit.yml | 8 ++-- 69 files changed, 109 insertions(+), 109 deletions(-) rename test/spec/retryable-writes/{ => legacy}/README.rst (100%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite-serverErrors.json (97%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite-serverErrors.yml (98%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite.json (100%) rename test/spec/retryable-writes/{ => legacy}/bulkWrite.yml (100%) rename test/spec/retryable-writes/{ => legacy}/deleteMany.json (100%) rename test/spec/retryable-writes/{ => legacy}/deleteMany.yml (100%) rename test/spec/retryable-writes/{ => legacy}/deleteOne-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/deleteOne-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/deleteOne-serverErrors.json (95%) rename test/spec/retryable-writes/{ => legacy}/deleteOne-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/deleteOne.json (100%) rename test/spec/retryable-writes/{ => legacy}/deleteOne.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete-serverErrors.json (95%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndDelete.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace-serverErrors.json (96%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndReplace.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate-serverErrors.json (96%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate.json (100%) rename test/spec/retryable-writes/{ => legacy}/findOneAndUpdate.yml (100%) rename test/spec/retryable-writes/{ => legacy}/insertMany-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/insertMany-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/insertMany-serverErrors.json (96%) rename test/spec/retryable-writes/{ => legacy}/insertMany-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/insertMany.json (100%) rename test/spec/retryable-writes/{ => legacy}/insertMany.yml (100%) rename test/spec/retryable-writes/{ => legacy}/insertOne-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/insertOne-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/insertOne-serverErrors.json (97%) rename test/spec/retryable-writes/{ => legacy}/insertOne-serverErrors.yml (98%) rename test/spec/retryable-writes/{ => legacy}/insertOne.json (100%) rename test/spec/retryable-writes/{ => legacy}/insertOne.yml (100%) rename test/spec/retryable-writes/{ => legacy}/replaceOne-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/replaceOne-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/replaceOne-serverErrors.json (96%) rename test/spec/retryable-writes/{ => legacy}/replaceOne-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/replaceOne.json (100%) rename test/spec/retryable-writes/{ => legacy}/replaceOne.yml (100%) rename test/spec/retryable-writes/{ => legacy}/updateMany.json (100%) rename test/spec/retryable-writes/{ => legacy}/updateMany.yml (100%) rename test/spec/retryable-writes/{ => legacy}/updateOne-errorLabels.json (100%) rename test/spec/retryable-writes/{ => legacy}/updateOne-errorLabels.yml (100%) rename test/spec/retryable-writes/{ => legacy}/updateOne-serverErrors.json (96%) rename test/spec/retryable-writes/{ => legacy}/updateOne-serverErrors.yml (97%) rename test/spec/retryable-writes/{ => legacy}/updateOne.json (100%) rename test/spec/retryable-writes/{ => legacy}/updateOne.yml (100%) create mode 100644 test/spec/retryable-writes/unified/.gitkeep diff --git a/test/integration/retryable-writes/retryable_writes.spec.test.js b/test/integration/retryable-writes/retryable_writes.spec.test.js index 0028a6140e..d85f0881f0 100644 --- a/test/integration/retryable-writes/retryable_writes.spec.test.js +++ b/test/integration/retryable-writes/retryable_writes.spec.test.js @@ -5,9 +5,9 @@ const { loadSpecTests } = require('../../spec'); const { legacyRunOnToRunOnRequirement } = require('../../tools/spec-runner'); const { isAnyRequirementSatisfied } = require('../../tools/unified-spec-runner/unified-utils'); -describe('Retryable Writes', function () { +describe('Legacy Retryable Writes specs', function () { let ctx = {}; - const retryableWrites = loadSpecTests('retryable-writes'); + const retryableWrites = loadSpecTests('retryable-writes/legacy'); for (const suite of retryableWrites) { describe(suite.name, function () { diff --git a/test/spec/retryable-writes/README.rst b/test/spec/retryable-writes/legacy/README.rst similarity index 100% rename from test/spec/retryable-writes/README.rst rename to test/spec/retryable-writes/legacy/README.rst diff --git a/test/spec/retryable-writes/bulkWrite-errorLabels.json b/test/spec/retryable-writes/legacy/bulkWrite-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/bulkWrite-errorLabels.json rename to test/spec/retryable-writes/legacy/bulkWrite-errorLabels.json diff --git a/test/spec/retryable-writes/bulkWrite-errorLabels.yml b/test/spec/retryable-writes/legacy/bulkWrite-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/bulkWrite-errorLabels.yml rename to test/spec/retryable-writes/legacy/bulkWrite-errorLabels.yml diff --git a/test/spec/retryable-writes/bulkWrite-serverErrors.json b/test/spec/retryable-writes/legacy/bulkWrite-serverErrors.json similarity index 97% rename from test/spec/retryable-writes/bulkWrite-serverErrors.json rename to test/spec/retryable-writes/legacy/bulkWrite-serverErrors.json index 9d792ceafb..1e6cc74c05 100644 --- a/test/spec/retryable-writes/bulkWrite-serverErrors.json +++ b/test/spec/retryable-writes/legacy/bulkWrite-serverErrors.json @@ -119,12 +119,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/bulkWrite-serverErrors.yml b/test/spec/retryable-writes/legacy/bulkWrite-serverErrors.yml similarity index 98% rename from test/spec/retryable-writes/bulkWrite-serverErrors.yml rename to test/spec/retryable-writes/legacy/bulkWrite-serverErrors.yml index 0235a8a1ce..6ca6540f61 100644 --- a/test/spec/retryable-writes/bulkWrite-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/bulkWrite-serverErrors.yml @@ -58,10 +58,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "bulkWrite" arguments: diff --git a/test/spec/retryable-writes/bulkWrite.json b/test/spec/retryable-writes/legacy/bulkWrite.json similarity index 100% rename from test/spec/retryable-writes/bulkWrite.json rename to test/spec/retryable-writes/legacy/bulkWrite.json diff --git a/test/spec/retryable-writes/bulkWrite.yml b/test/spec/retryable-writes/legacy/bulkWrite.yml similarity index 100% rename from test/spec/retryable-writes/bulkWrite.yml rename to test/spec/retryable-writes/legacy/bulkWrite.yml diff --git a/test/spec/retryable-writes/deleteMany.json b/test/spec/retryable-writes/legacy/deleteMany.json similarity index 100% rename from test/spec/retryable-writes/deleteMany.json rename to test/spec/retryable-writes/legacy/deleteMany.json diff --git a/test/spec/retryable-writes/deleteMany.yml b/test/spec/retryable-writes/legacy/deleteMany.yml similarity index 100% rename from test/spec/retryable-writes/deleteMany.yml rename to test/spec/retryable-writes/legacy/deleteMany.yml diff --git a/test/spec/retryable-writes/deleteOne-errorLabels.json b/test/spec/retryable-writes/legacy/deleteOne-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/deleteOne-errorLabels.json rename to test/spec/retryable-writes/legacy/deleteOne-errorLabels.json diff --git a/test/spec/retryable-writes/deleteOne-errorLabels.yml b/test/spec/retryable-writes/legacy/deleteOne-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/deleteOne-errorLabels.yml rename to test/spec/retryable-writes/legacy/deleteOne-errorLabels.yml diff --git a/test/spec/retryable-writes/deleteOne-serverErrors.json b/test/spec/retryable-writes/legacy/deleteOne-serverErrors.json similarity index 95% rename from test/spec/retryable-writes/deleteOne-serverErrors.json rename to test/spec/retryable-writes/legacy/deleteOne-serverErrors.json index 4eab2fa296..a1a27838de 100644 --- a/test/spec/retryable-writes/deleteOne-serverErrors.json +++ b/test/spec/retryable-writes/legacy/deleteOne-serverErrors.json @@ -75,12 +75,12 @@ "failCommands": [ "delete" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/deleteOne-serverErrors.yml b/test/spec/retryable-writes/legacy/deleteOne-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/deleteOne-serverErrors.yml rename to test/spec/retryable-writes/legacy/deleteOne-serverErrors.yml index 73cab927e7..f4c98c919b 100644 --- a/test/spec/retryable-writes/deleteOne-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/deleteOne-serverErrors.yml @@ -37,10 +37,10 @@ tests: mode: { times: 1 } data: failCommands: ["delete"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "deleteOne" arguments: diff --git a/test/spec/retryable-writes/deleteOne.json b/test/spec/retryable-writes/legacy/deleteOne.json similarity index 100% rename from test/spec/retryable-writes/deleteOne.json rename to test/spec/retryable-writes/legacy/deleteOne.json diff --git a/test/spec/retryable-writes/deleteOne.yml b/test/spec/retryable-writes/legacy/deleteOne.yml similarity index 100% rename from test/spec/retryable-writes/deleteOne.yml rename to test/spec/retryable-writes/legacy/deleteOne.yml diff --git a/test/spec/retryable-writes/findOneAndDelete-errorLabels.json b/test/spec/retryable-writes/legacy/findOneAndDelete-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/findOneAndDelete-errorLabels.json rename to test/spec/retryable-writes/legacy/findOneAndDelete-errorLabels.json diff --git a/test/spec/retryable-writes/findOneAndDelete-errorLabels.yml b/test/spec/retryable-writes/legacy/findOneAndDelete-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndDelete-errorLabels.yml rename to test/spec/retryable-writes/legacy/findOneAndDelete-errorLabels.yml diff --git a/test/spec/retryable-writes/findOneAndDelete-serverErrors.json b/test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.json similarity index 95% rename from test/spec/retryable-writes/findOneAndDelete-serverErrors.json rename to test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.json index 4c10861614..c18b63f456 100644 --- a/test/spec/retryable-writes/findOneAndDelete-serverErrors.json +++ b/test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.json @@ -81,12 +81,12 @@ "failCommands": [ "findAndModify" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/findOneAndDelete-serverErrors.yml b/test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/findOneAndDelete-serverErrors.yml rename to test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.yml index 5926026f08..688ee3342e 100644 --- a/test/spec/retryable-writes/findOneAndDelete-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/findOneAndDelete-serverErrors.yml @@ -37,10 +37,10 @@ tests: mode: { times: 1 } data: failCommands: ["findAndModify"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "findOneAndDelete" arguments: diff --git a/test/spec/retryable-writes/findOneAndDelete.json b/test/spec/retryable-writes/legacy/findOneAndDelete.json similarity index 100% rename from test/spec/retryable-writes/findOneAndDelete.json rename to test/spec/retryable-writes/legacy/findOneAndDelete.json diff --git a/test/spec/retryable-writes/findOneAndDelete.yml b/test/spec/retryable-writes/legacy/findOneAndDelete.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndDelete.yml rename to test/spec/retryable-writes/legacy/findOneAndDelete.yml diff --git a/test/spec/retryable-writes/findOneAndReplace-errorLabels.json b/test/spec/retryable-writes/legacy/findOneAndReplace-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/findOneAndReplace-errorLabels.json rename to test/spec/retryable-writes/legacy/findOneAndReplace-errorLabels.json diff --git a/test/spec/retryable-writes/findOneAndReplace-errorLabels.yml b/test/spec/retryable-writes/legacy/findOneAndReplace-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndReplace-errorLabels.yml rename to test/spec/retryable-writes/legacy/findOneAndReplace-errorLabels.yml diff --git a/test/spec/retryable-writes/findOneAndReplace-serverErrors.json b/test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.json similarity index 96% rename from test/spec/retryable-writes/findOneAndReplace-serverErrors.json rename to test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.json index 64c69e2f6d..944a3af848 100644 --- a/test/spec/retryable-writes/findOneAndReplace-serverErrors.json +++ b/test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.json @@ -85,12 +85,12 @@ "failCommands": [ "findAndModify" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/findOneAndReplace-serverErrors.yml b/test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/findOneAndReplace-serverErrors.yml rename to test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.yml index 5a483e60b6..6f0f31874a 100644 --- a/test/spec/retryable-writes/findOneAndReplace-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/findOneAndReplace-serverErrors.yml @@ -39,10 +39,10 @@ tests: mode: { times: 1 } data: failCommands: ["findAndModify"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "findOneAndReplace" arguments: diff --git a/test/spec/retryable-writes/findOneAndReplace.json b/test/spec/retryable-writes/legacy/findOneAndReplace.json similarity index 100% rename from test/spec/retryable-writes/findOneAndReplace.json rename to test/spec/retryable-writes/legacy/findOneAndReplace.json diff --git a/test/spec/retryable-writes/findOneAndReplace.yml b/test/spec/retryable-writes/legacy/findOneAndReplace.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndReplace.yml rename to test/spec/retryable-writes/legacy/findOneAndReplace.yml diff --git a/test/spec/retryable-writes/findOneAndUpdate-errorLabels.json b/test/spec/retryable-writes/legacy/findOneAndUpdate-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/findOneAndUpdate-errorLabels.json rename to test/spec/retryable-writes/legacy/findOneAndUpdate-errorLabels.json diff --git a/test/spec/retryable-writes/findOneAndUpdate-errorLabels.yml b/test/spec/retryable-writes/legacy/findOneAndUpdate-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndUpdate-errorLabels.yml rename to test/spec/retryable-writes/legacy/findOneAndUpdate-errorLabels.yml diff --git a/test/spec/retryable-writes/findOneAndUpdate-serverErrors.json b/test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.json similarity index 96% rename from test/spec/retryable-writes/findOneAndUpdate-serverErrors.json rename to test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.json index 9f54604992..e83a610615 100644 --- a/test/spec/retryable-writes/findOneAndUpdate-serverErrors.json +++ b/test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.json @@ -86,12 +86,12 @@ "failCommands": [ "findAndModify" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/findOneAndUpdate-serverErrors.yml b/test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/findOneAndUpdate-serverErrors.yml rename to test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.yml index 3c1fbe8226..c1e0b6a7ca 100644 --- a/test/spec/retryable-writes/findOneAndUpdate-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/findOneAndUpdate-serverErrors.yml @@ -39,10 +39,10 @@ tests: mode: { times: 1 } data: failCommands: ["findAndModify"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "findOneAndUpdate" arguments: diff --git a/test/spec/retryable-writes/findOneAndUpdate.json b/test/spec/retryable-writes/legacy/findOneAndUpdate.json similarity index 100% rename from test/spec/retryable-writes/findOneAndUpdate.json rename to test/spec/retryable-writes/legacy/findOneAndUpdate.json diff --git a/test/spec/retryable-writes/findOneAndUpdate.yml b/test/spec/retryable-writes/legacy/findOneAndUpdate.yml similarity index 100% rename from test/spec/retryable-writes/findOneAndUpdate.yml rename to test/spec/retryable-writes/legacy/findOneAndUpdate.yml diff --git a/test/spec/retryable-writes/insertMany-errorLabels.json b/test/spec/retryable-writes/legacy/insertMany-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/insertMany-errorLabels.json rename to test/spec/retryable-writes/legacy/insertMany-errorLabels.json diff --git a/test/spec/retryable-writes/insertMany-errorLabels.yml b/test/spec/retryable-writes/legacy/insertMany-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/insertMany-errorLabels.yml rename to test/spec/retryable-writes/legacy/insertMany-errorLabels.yml diff --git a/test/spec/retryable-writes/insertMany-serverErrors.json b/test/spec/retryable-writes/legacy/insertMany-serverErrors.json similarity index 96% rename from test/spec/retryable-writes/insertMany-serverErrors.json rename to test/spec/retryable-writes/legacy/insertMany-serverErrors.json index 7b45b506c9..fe8dbf4a62 100644 --- a/test/spec/retryable-writes/insertMany-serverErrors.json +++ b/test/spec/retryable-writes/legacy/insertMany-serverErrors.json @@ -92,12 +92,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/insertMany-serverErrors.yml b/test/spec/retryable-writes/legacy/insertMany-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/insertMany-serverErrors.yml rename to test/spec/retryable-writes/legacy/insertMany-serverErrors.yml index 140329fcb8..0dc7518c6b 100644 --- a/test/spec/retryable-writes/insertMany-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/insertMany-serverErrors.yml @@ -41,10 +41,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertMany" arguments: diff --git a/test/spec/retryable-writes/insertMany.json b/test/spec/retryable-writes/legacy/insertMany.json similarity index 100% rename from test/spec/retryable-writes/insertMany.json rename to test/spec/retryable-writes/legacy/insertMany.json diff --git a/test/spec/retryable-writes/insertMany.yml b/test/spec/retryable-writes/legacy/insertMany.yml similarity index 100% rename from test/spec/retryable-writes/insertMany.yml rename to test/spec/retryable-writes/legacy/insertMany.yml diff --git a/test/spec/retryable-writes/insertOne-errorLabels.json b/test/spec/retryable-writes/legacy/insertOne-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/insertOne-errorLabels.json rename to test/spec/retryable-writes/legacy/insertOne-errorLabels.json diff --git a/test/spec/retryable-writes/insertOne-errorLabels.yml b/test/spec/retryable-writes/legacy/insertOne-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/insertOne-errorLabels.yml rename to test/spec/retryable-writes/legacy/insertOne-errorLabels.yml diff --git a/test/spec/retryable-writes/insertOne-serverErrors.json b/test/spec/retryable-writes/legacy/insertOne-serverErrors.json similarity index 97% rename from test/spec/retryable-writes/insertOne-serverErrors.json rename to test/spec/retryable-writes/legacy/insertOne-serverErrors.json index e8571f8cf9..5179a6ab75 100644 --- a/test/spec/retryable-writes/insertOne-serverErrors.json +++ b/test/spec/retryable-writes/legacy/insertOne-serverErrors.json @@ -761,12 +761,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11600, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, @@ -812,12 +812,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11602, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, @@ -863,12 +863,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 189, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, @@ -914,12 +914,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, @@ -965,12 +965,12 @@ "failCommands": [ "insert" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/insertOne-serverErrors.yml b/test/spec/retryable-writes/legacy/insertOne-serverErrors.yml similarity index 98% rename from test/spec/retryable-writes/insertOne-serverErrors.yml rename to test/spec/retryable-writes/legacy/insertOne-serverErrors.yml index af50e761ee..bfbd187742 100644 --- a/test/spec/retryable-writes/insertOne-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/insertOne-serverErrors.yml @@ -347,10 +347,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11600 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertOne" arguments: @@ -370,10 +370,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11602 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertOne" arguments: @@ -393,10 +393,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 189 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertOne" arguments: @@ -416,10 +416,10 @@ tests: mode: { times: 1 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertOne" arguments: @@ -439,10 +439,10 @@ tests: mode: { times: 2 } data: failCommands: ["insert"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "insertOne" arguments: diff --git a/test/spec/retryable-writes/insertOne.json b/test/spec/retryable-writes/legacy/insertOne.json similarity index 100% rename from test/spec/retryable-writes/insertOne.json rename to test/spec/retryable-writes/legacy/insertOne.json diff --git a/test/spec/retryable-writes/insertOne.yml b/test/spec/retryable-writes/legacy/insertOne.yml similarity index 100% rename from test/spec/retryable-writes/insertOne.yml rename to test/spec/retryable-writes/legacy/insertOne.yml diff --git a/test/spec/retryable-writes/replaceOne-errorLabels.json b/test/spec/retryable-writes/legacy/replaceOne-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/replaceOne-errorLabels.json rename to test/spec/retryable-writes/legacy/replaceOne-errorLabels.json diff --git a/test/spec/retryable-writes/replaceOne-errorLabels.yml b/test/spec/retryable-writes/legacy/replaceOne-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/replaceOne-errorLabels.yml rename to test/spec/retryable-writes/legacy/replaceOne-errorLabels.yml diff --git a/test/spec/retryable-writes/replaceOne-serverErrors.json b/test/spec/retryable-writes/legacy/replaceOne-serverErrors.json similarity index 96% rename from test/spec/retryable-writes/replaceOne-serverErrors.json rename to test/spec/retryable-writes/legacy/replaceOne-serverErrors.json index 7457228cd7..6b35722e12 100644 --- a/test/spec/retryable-writes/replaceOne-serverErrors.json +++ b/test/spec/retryable-writes/legacy/replaceOne-serverErrors.json @@ -85,12 +85,12 @@ "failCommands": [ "update" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/replaceOne-serverErrors.yml b/test/spec/retryable-writes/legacy/replaceOne-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/replaceOne-serverErrors.yml rename to test/spec/retryable-writes/legacy/replaceOne-serverErrors.yml index 292f96ecb0..3dd79db750 100644 --- a/test/spec/retryable-writes/replaceOne-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/replaceOne-serverErrors.yml @@ -41,10 +41,10 @@ tests: mode: { times: 1 } data: failCommands: ["update"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "replaceOne" arguments: diff --git a/test/spec/retryable-writes/replaceOne.json b/test/spec/retryable-writes/legacy/replaceOne.json similarity index 100% rename from test/spec/retryable-writes/replaceOne.json rename to test/spec/retryable-writes/legacy/replaceOne.json diff --git a/test/spec/retryable-writes/replaceOne.yml b/test/spec/retryable-writes/legacy/replaceOne.yml similarity index 100% rename from test/spec/retryable-writes/replaceOne.yml rename to test/spec/retryable-writes/legacy/replaceOne.yml diff --git a/test/spec/retryable-writes/updateMany.json b/test/spec/retryable-writes/legacy/updateMany.json similarity index 100% rename from test/spec/retryable-writes/updateMany.json rename to test/spec/retryable-writes/legacy/updateMany.json diff --git a/test/spec/retryable-writes/updateMany.yml b/test/spec/retryable-writes/legacy/updateMany.yml similarity index 100% rename from test/spec/retryable-writes/updateMany.yml rename to test/spec/retryable-writes/legacy/updateMany.yml diff --git a/test/spec/retryable-writes/updateOne-errorLabels.json b/test/spec/retryable-writes/legacy/updateOne-errorLabels.json similarity index 100% rename from test/spec/retryable-writes/updateOne-errorLabels.json rename to test/spec/retryable-writes/legacy/updateOne-errorLabels.json diff --git a/test/spec/retryable-writes/updateOne-errorLabels.yml b/test/spec/retryable-writes/legacy/updateOne-errorLabels.yml similarity index 100% rename from test/spec/retryable-writes/updateOne-errorLabels.yml rename to test/spec/retryable-writes/legacy/updateOne-errorLabels.yml diff --git a/test/spec/retryable-writes/updateOne-serverErrors.json b/test/spec/retryable-writes/legacy/updateOne-serverErrors.json similarity index 96% rename from test/spec/retryable-writes/updateOne-serverErrors.json rename to test/spec/retryable-writes/legacy/updateOne-serverErrors.json index 1160198019..cf274f57e0 100644 --- a/test/spec/retryable-writes/updateOne-serverErrors.json +++ b/test/spec/retryable-writes/legacy/updateOne-serverErrors.json @@ -86,12 +86,12 @@ "failCommands": [ "update" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/retryable-writes/updateOne-serverErrors.yml b/test/spec/retryable-writes/legacy/updateOne-serverErrors.yml similarity index 97% rename from test/spec/retryable-writes/updateOne-serverErrors.yml rename to test/spec/retryable-writes/legacy/updateOne-serverErrors.yml index 35ed406a54..fffe851cae 100644 --- a/test/spec/retryable-writes/updateOne-serverErrors.yml +++ b/test/spec/retryable-writes/legacy/updateOne-serverErrors.yml @@ -41,10 +41,10 @@ tests: mode: { times: 1 } data: failCommands: ["update"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operation: name: "updateOne" arguments: diff --git a/test/spec/retryable-writes/updateOne.json b/test/spec/retryable-writes/legacy/updateOne.json similarity index 100% rename from test/spec/retryable-writes/updateOne.json rename to test/spec/retryable-writes/legacy/updateOne.json diff --git a/test/spec/retryable-writes/updateOne.yml b/test/spec/retryable-writes/legacy/updateOne.yml similarity index 100% rename from test/spec/retryable-writes/updateOne.yml rename to test/spec/retryable-writes/legacy/updateOne.yml diff --git a/test/spec/retryable-writes/unified/.gitkeep b/test/spec/retryable-writes/unified/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/spec/transactions/legacy/error-labels.json b/test/spec/transactions/legacy/error-labels.json index a57f216b9b..0be19c731c 100644 --- a/test/spec/transactions/legacy/error-labels.json +++ b/test/spec/transactions/legacy/error-labels.json @@ -963,12 +963,12 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } }, diff --git a/test/spec/transactions/legacy/error-labels.yml b/test/spec/transactions/legacy/error-labels.yml index 5f2c7085c1..1f8dbe4db8 100644 --- a/test/spec/transactions/legacy/error-labels.yml +++ b/test/spec/transactions/legacy/error-labels.yml @@ -590,10 +590,10 @@ tests: mode: { times: 2 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] operations: - name: startTransaction diff --git a/test/spec/transactions/legacy/mongos-recovery-token.json b/test/spec/transactions/legacy/mongos-recovery-token.json index 02c2002f75..da4e9861d1 100644 --- a/test/spec/transactions/legacy/mongos-recovery-token.json +++ b/test/spec/transactions/legacy/mongos-recovery-token.json @@ -180,12 +180,12 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errmsg": "Replication is being shut down", - "errorLabels": [ - "RetryableWriteError" - ] + "errmsg": "Replication is being shut down" } } } diff --git a/test/spec/transactions/legacy/mongos-recovery-token.yml b/test/spec/transactions/legacy/mongos-recovery-token.yml index 688f08256f..e8763db88f 100644 --- a/test/spec/transactions/legacy/mongos-recovery-token.yml +++ b/test/spec/transactions/legacy/mongos-recovery-token.yml @@ -118,10 +118,10 @@ tests: mode: { times: 1 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 errmsg: Replication is being shut down - errorLabels: ["RetryableWriteError"] # The client sees a retryable writeConcernError on the first # commitTransaction due to the fail point but it actually succeeds on the # server (SERVER-39346). The retry will succeed both on a new mongos and diff --git a/test/spec/transactions/legacy/retryable-abort.json b/test/spec/transactions/legacy/retryable-abort.json index b712e80862..13cc7c88fb 100644 --- a/test/spec/transactions/legacy/retryable-abort.json +++ b/test/spec/transactions/legacy/retryable-abort.json @@ -1556,11 +1556,11 @@ "failCommands": [ "abortTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11600, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -1673,11 +1673,11 @@ "failCommands": [ "abortTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11602, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -1790,11 +1790,11 @@ "failCommands": [ "abortTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 189, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -1907,11 +1907,11 @@ "failCommands": [ "abortTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } diff --git a/test/spec/transactions/legacy/retryable-abort.yml b/test/spec/transactions/legacy/retryable-abort.yml index a6ccc531b7..b129189d74 100644 --- a/test/spec/transactions/legacy/retryable-abort.yml +++ b/test/spec/transactions/legacy/retryable-abort.yml @@ -1021,9 +1021,9 @@ tests: mode: { times: 1 } data: failCommands: ["abortTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11600 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1096,9 +1096,9 @@ tests: mode: { times: 1 } data: failCommands: ["abortTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11602 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1171,9 +1171,9 @@ tests: mode: { times: 1 } data: failCommands: ["abortTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 189 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1246,9 +1246,9 @@ tests: mode: { times: 1 } data: failCommands: ["abortTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: diff --git a/test/spec/transactions/legacy/retryable-commit.json b/test/spec/transactions/legacy/retryable-commit.json index d83a1d9f52..49148c62d2 100644 --- a/test/spec/transactions/legacy/retryable-commit.json +++ b/test/spec/transactions/legacy/retryable-commit.json @@ -1855,11 +1855,11 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11600, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -1977,11 +1977,11 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 11602, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -2099,11 +2099,11 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 189, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } @@ -2221,11 +2221,11 @@ "failCommands": [ "commitTransaction" ], + "errorLabels": [ + "RetryableWriteError" + ], "writeConcernError": { "code": 91, - "errorLabels": [ - "RetryableWriteError" - ], "errmsg": "Replication is being shut down" } } diff --git a/test/spec/transactions/legacy/retryable-commit.yml b/test/spec/transactions/legacy/retryable-commit.yml index 8e0037f28e..f38b7343a1 100644 --- a/test/spec/transactions/legacy/retryable-commit.yml +++ b/test/spec/transactions/legacy/retryable-commit.yml @@ -1162,9 +1162,9 @@ tests: mode: { times: 1 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11600 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1238,9 +1238,9 @@ tests: mode: { times: 1 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 11602 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1314,9 +1314,9 @@ tests: mode: { times: 1 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 189 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: @@ -1390,9 +1390,9 @@ tests: mode: { times: 1 } data: failCommands: ["commitTransaction"] + errorLabels: ["RetryableWriteError"] writeConcernError: code: 91 - errorLabels: ["RetryableWriteError"] errmsg: Replication is being shut down operations: