Skip to content

Commit

Permalink
test(NODE-3885): update spec tests to remove legacy language (#3139)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Feb 9, 2022
1 parent 44bbd6e commit 3807d01
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 32 deletions.
6 changes: 3 additions & 3 deletions test/spec/retryable-writes/insertOne-serverErrors.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
}
},
{
"description": "InsertOne succeeds after NotMaster",
"description": "InsertOne succeeds after NotWritablePrimary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -167,7 +167,7 @@
}
},
{
"description": "InsertOne succeeds after NotMasterOrSecondary",
"description": "InsertOne succeeds after NotPrimaryOrSecondary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -216,7 +216,7 @@
}
},
{
"description": "InsertOne succeeds after NotMasterNoSlaveOk",
"description": "InsertOne succeeds after NotPrimaryNoSecondaryOk",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down
6 changes: 3 additions & 3 deletions test/spec/retryable-writes/insertOne-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tests:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
-
description: "InsertOne succeeds after NotMaster"
description: "InsertOne succeeds after NotWritablePrimary"
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
Expand All @@ -78,7 +78,7 @@ tests:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
-
description: "InsertOne succeeds after NotMasterOrSecondary"
description: "InsertOne succeeds after NotPrimaryOrSecondary"
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
Expand All @@ -100,7 +100,7 @@ tests:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
-
description: "InsertOne succeeds after NotMasterNoSlaveOk"
description: "InsertOne succeeds after NotPrimaryNoSecondaryOk"
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
Expand Down
2 changes: 1 addition & 1 deletion test/spec/transactions-convenient-api/commit-retry.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
}
},
{
"description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotMaster)",
"description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotWritablePrimary)",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/transactions-convenient-api/commit-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ tests:
data:
- { _id: 1 }
-
description: commit is retried after commitTransaction UnknownTransactionCommitResult (NotMaster)
description: commit is retried after commitTransaction UnknownTransactionCommitResult (NotWritablePrimary)
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
data:
failCommands: ["commitTransaction"]
errorCode: 10107 # NotMaster
errorCode: 10107 # NotWritablePrimary
errorLabels: ["RetryableWriteError"] # SPEC-1565
closeConnection: false
operations:
Expand Down
2 changes: 1 addition & 1 deletion test/spec/transactions/legacy/error-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}
},
{
"description": "NotMaster errors contain transient label",
"description": "NotWritablePrimary errors contain transient label",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/transactions/legacy/error-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ tests:
collection:
data: []

- description: NotMaster errors contain transient label
- description: NotWritablePrimary errors contain transient label

failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: ["insert"]
errorCode: 10107 # NotMaster
errorCode: 10107 # NotWritablePrimary

operations:
- name: startTransaction
Expand Down
3 changes: 2 additions & 1 deletion test/spec/transactions/legacy/mongos-recovery-token.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@
"data": {
"failCommands": [
"commitTransaction",
"isMaster"
"isMaster",
"hello"
],
"closeConnection": true
}
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/mongos-recovery-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ tests:
result:
insertedId: 1
# Enable the fail point only on the Mongos that session0 is pinned to.
# Fail isMaster to prevent the heartbeat requested directly after the
# Fail hello/legacy hello to prevent the heartbeat requested directly after the
# retryable commit error from racing with server selection for the retry.
# Note: times: 7 is slightly artbitrary but it accounts for one failed
# commit and some SDAM heartbeats. A test runner will have multiple
Expand All @@ -210,15 +210,15 @@ tests:
configureFailPoint: failCommand
mode: { times: 7 }
data:
failCommands: ["commitTransaction", "isMaster"]
failCommands: ["commitTransaction", "isMaster", "hello"]
closeConnection: true
# The first commitTransaction sees a retryable connection error due to
# the fail point and also fails on the server. The retry attempt on a
# new mongos will wait for the transaction to timeout and will fail
# because the transaction was aborted. Note that the retry attempt should
# not select the original mongos because that server's SDAM state is
# reset by the connection error, heartbeatFrequencyMS is high, and
# subsequent isMaster heartbeats should fail.
# subsequent heartbeats should fail.
- name: commitTransaction
object: session0
result:
Expand Down
3 changes: 2 additions & 1 deletion test/spec/transactions/legacy/pin-mongos.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,8 @@
"data": {
"failCommands": [
"insert",
"isMaster"
"isMaster",
"hello"
],
"closeConnection": true
}
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/pin-mongos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ tests:
result:
insertedId: 3
# Enable the fail point only on the Mongos that session0 is pinned to.
# Fail isMaster to prevent the heartbeat requested directly after the
# Fail hello/legacy hello to prevent the heartbeat requested directly after the
# insert error from racing with server selection for the commit.
# Note: times: 7 is slightly artbitrary but it accounts for one failed
# insert and some SDAM heartbeats. A test runner will have multiple
Expand All @@ -478,7 +478,7 @@ tests:
configureFailPoint: failCommand
mode: { times: 7 }
data:
failCommands: ["insert", "isMaster"]
failCommands: ["insert", "isMaster", "hello"]
closeConnection: true
- name: insertOne
object: collection
Expand All @@ -498,7 +498,7 @@ tests:
#
# Note that the commit attempt should not select the original mongos
# because that server's SDAM state is reset by the connection error,
# heartbeatFrequencyMS is high, and subsequent isMaster heartbeats
# heartbeatFrequencyMS is high, and subsequent heartbeats
# should fail.
- name: commitTransaction
object: session0
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/retryable-abort.json
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
}
},
{
"description": "abortTransaction succeeds after NotMaster",
"description": "abortTransaction succeeds after NotWritablePrimary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -506,7 +506,7 @@
}
},
{
"description": "abortTransaction succeeds after NotMasterOrSecondary",
"description": "abortTransaction succeeds after NotPrimaryOrSecondary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -610,7 +610,7 @@
}
},
{
"description": "abortTransaction succeeds after NotMasterNoSlaveOk",
"description": "abortTransaction succeeds after NotPrimaryNoSecondaryOk",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/retryable-abort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ tests:
collection:
data: []

- description: abortTransaction succeeds after NotMaster
- description: abortTransaction succeeds after NotWritablePrimary

failPoint:
configureFailPoint: failCommand
Expand Down Expand Up @@ -334,7 +334,7 @@ tests:
collection:
data: []

- description: abortTransaction succeeds after NotMasterOrSecondary
- description: abortTransaction succeeds after NotPrimaryOrSecondary

failPoint:
configureFailPoint: failCommand
Expand Down Expand Up @@ -402,7 +402,7 @@ tests:
collection:
data: []

- description: abortTransaction succeeds after NotMasterNoSlaveOk
- description: abortTransaction succeeds after NotPrimaryNoSecondaryOk

failPoint:
configureFailPoint: failCommand
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/retryable-commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@
}
},
{
"description": "commitTransaction succeeds after NotMaster",
"description": "commitTransaction succeeds after NotWritablePrimary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -735,7 +735,7 @@
}
},
{
"description": "commitTransaction succeeds after NotMasterOrSecondary",
"description": "commitTransaction succeeds after NotPrimaryOrSecondary",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -846,7 +846,7 @@
}
},
{
"description": "commitTransaction succeeds after NotMasterNoSlaveOk",
"description": "commitTransaction succeeds after NotPrimaryNoSecondaryOk",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down
6 changes: 3 additions & 3 deletions test/spec/transactions/legacy/retryable-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ tests:
data:
- _id: 1

- description: commitTransaction succeeds after NotMaster
- description: commitTransaction succeeds after NotWritablePrimary

failPoint:
configureFailPoint: failCommand
Expand Down Expand Up @@ -455,7 +455,7 @@ tests:
data:
- _id: 1

- description: commitTransaction succeeds after NotMasterOrSecondary
- description: commitTransaction succeeds after NotPrimaryOrSecondary

failPoint:
configureFailPoint: failCommand
Expand Down Expand Up @@ -525,7 +525,7 @@ tests:
data:
- _id: 1

- description: commitTransaction succeeds after NotMasterNoSlaveOk
- description: commitTransaction succeeds after NotPrimaryNoSecondaryOk

failPoint:
configureFailPoint: failCommand
Expand Down

0 comments on commit 3807d01

Please sign in to comment.