Skip to content

Commit

Permalink
test(NODE-3070): Ensure that SDAM should ignore the writeErrors field (
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken authored Mar 31, 2021
1 parent 312ffef commit af49ba3
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"description": "writeErrors field is ignored",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"ismaster": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 9,
"topologyVersion": {
"processId": {
"$oid": "000000000000000000000001"
},
"counter": {
"$numberLong": "1"
}
}
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": {
"processId": {
"$oid": "000000000000000000000001"
},
"counter": {
"$numberLong": "1"
}
},
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Ignore command error with writeErrors field",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 9,
"type": "command",
"response": {
"ok": 1,
"writeErrors": [
{
"errmsg": "NotMasterNoSlaveOk",
"code": 13435
}
]
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": {
"processId": {
"$oid": "000000000000000000000001"
},
"counter": {
"$numberLong": "1"
}
},
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
description: writeErrors field is ignored
uri: mongodb://a/?replicaSet=rs
phases:
- description: Primary A is discovered
responses:
- - a:27017
- ok: 1
ismaster: true
hosts:
- a:27017
setName: rs
minWireVersion: 0
maxWireVersion: 9
topologyVersion: &topologyVersion_1_1
processId:
"$oid": '000000000000000000000001'
counter:
"$numberLong": '1'
outcome: &outcome
servers:
a:27017:
type: RSPrimary
setName: rs
topologyVersion: *topologyVersion_1_1
pool:
generation: 0
topologyType: ReplicaSetWithPrimary
logicalSessionTimeoutMinutes: null
setName: rs

- description: Ignore command error with writeErrors field
applicationErrors:
- address: a:27017
when: afterHandshakeCompletes
maxWireVersion: 9
type: command
response:
ok: 1
writeErrors:
- { errmsg: NotMasterNoSlaveOk, code: 13435 }
outcome: *outcome

0 comments on commit af49ba3

Please sign in to comment.