Skip to content

test(NODE-4955): sync unacknowledged write spec tests #4380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"component": "command",
"data": {
"message": "Command succeeded",
"databaseName": "logging-tests",
"commandName": "ping",
"reply": {
"$$type": "string"
Expand Down Expand Up @@ -177,6 +178,7 @@
"component": "command",
"data": {
"message": "Command failed",
"databaseName": "logging-tests",
"commandName": "find",
"failure": {
"$$exists": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ tests:
component: command
data:
message: "Command succeeded"
databaseName: *databaseName
commandName: *commandName
reply: { $$type: string }
requestId: { $$type: [int, long] }
serverHost: { $$type: string }
serverPort: { $$type: [int, long] }
durationMS: { $$type: [double, int, long] }

- description: "A failed command"
operations:
- name: &commandName find
Expand All @@ -85,10 +86,10 @@ tests:
component: command
data:
message: "Command failed"
databaseName: *databaseName
commandName: *commandName
failure: { $$exists: true }
requestId: { $$type: [int, long] }
serverHost: { $$type: string }
serverPort: { $$type: [int, long] }
durationMS: { $$type: [double, int, long] }

26 changes: 17 additions & 9 deletions test/spec/command-logging-and-monitoring/monitoring/find.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "find",
"schemaVersion": "1.1",
"schemaVersion": "1.15",
"createEntities": [
{
"client": {
Expand Down Expand Up @@ -103,7 +103,8 @@
]
}
},
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down Expand Up @@ -198,7 +199,8 @@
]
}
},
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down Expand Up @@ -262,7 +264,8 @@
]
}
},
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down Expand Up @@ -338,7 +341,8 @@
]
}
},
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
},
{
Expand Down Expand Up @@ -376,7 +380,8 @@
]
}
},
"commandName": "getMore"
"commandName": "getMore",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down Expand Up @@ -464,7 +469,8 @@
]
}
},
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
},
{
Expand Down Expand Up @@ -498,7 +504,8 @@
]
}
},
"commandName": "getMore"
"commandName": "getMore",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down Expand Up @@ -539,7 +546,8 @@
},
{
"commandFailedEvent": {
"commandName": "find"
"commandName": "find",
"databaseName": "command-monitoring-tests"
}
}
]
Expand Down
10 changes: 9 additions & 1 deletion test/spec/command-logging-and-monitoring/monitoring/find.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: "find"

schemaVersion: "1.1"
schemaVersion: "1.15"

createEntities:
- client:
Expand Down Expand Up @@ -56,6 +56,7 @@ tests:
firstBatch:
- { _id: 1, x: 11 }
commandName: find
databaseName: *databaseName

- description: "A successful find with options"
operations:
Expand Down Expand Up @@ -98,6 +99,7 @@ tests:
- { x: 33 }
- { x: 22 }
commandName: find
databaseName: *databaseName

- description: "A successful find with showRecordId and returnKey"
operations:
Expand Down Expand Up @@ -131,6 +133,7 @@ tests:
- { _id: 4 }
- { _id: 5 }
commandName: find
databaseName: *databaseName

- description: "A successful find with a getMore"
operations:
Expand Down Expand Up @@ -162,6 +165,7 @@ tests:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
commandName: find
databaseName: *databaseName
- commandStartedEvent:
command:
getMore: { $$type: [ int, long ] }
Expand All @@ -179,6 +183,7 @@ tests:
- { _id: 4, x: 44 }
- { _id: 5, x: 55 }
commandName: getMore
databaseName: *databaseName

- description: "A successful find event with a getmore and the server kills the cursor (<= 4.4)"
runOnRequirements:
Expand Down Expand Up @@ -216,6 +221,7 @@ tests:
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
commandName: find
databaseName: *databaseName
- commandStartedEvent:
command:
getMore: { $$type: [ int, long ] }
Expand All @@ -232,6 +238,7 @@ tests:
nextBatch:
- { _id: 4, x: 44 }
commandName: getMore
databaseName: *databaseName

- description: "A failed find event"
operations:
Expand All @@ -252,3 +259,4 @@ tests:
databaseName: *databaseName
- commandFailedEvent:
commandName: find
databaseName: *databaseName
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,7 @@
"object": "collection",
"arguments": {
"filter": {}
},
"expectResult": [
{
"_id": 1,
"x": 11
},
{
"_id": "unorderedBulkWriteInsertW0",
"x": 44
}
]
}
}
],
"expectEvents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ tests:
object: *collection
arguments:
filter: { }
expectResult: [
{ _id: 1, x: 11 },
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
]
expectEvents:
- client: *client
ignoreExtraEvents: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"description": "writeConcernError",
"schemaVersion": "1.13",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "4.1.0",
"minServerVersion": "4.3.1",
"topologies": [
"replicaset"
],
Expand Down Expand Up @@ -66,11 +66,11 @@
"failCommands": [
"insert"
],
"errorLabels": [
"RetryableWriteError"
],
"writeConcernError": {
"code": 91,
"errorLabels": [
"RetryableWriteError"
]
"code": 91
}
}
}
Expand Down Expand Up @@ -112,11 +112,11 @@
"reply": {
"ok": 1,
"n": 1,
"errorLabels": [
"RetryableWriteError"
],
"writeConcernError": {
"code": 91,
"errorLabels": [
"RetryableWriteError"
]
"code": 91
}
},
"commandName": "insert"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description: "writeConcernError"
schemaVersion: "1.13"
schemaVersion: "1.4"
runOnRequirements:
-
minServerVersion: 4.1.0
minServerVersion: "4.3.1" # failCommand errorLabels option
topologies:
- replicaset
serverless: "forbid"
Expand Down Expand Up @@ -41,9 +41,9 @@ tests:
mode: { times: 1 }
data:
failCommands: [ insert ]
errorLabels: [ RetryableWriteError ]
writeConcernError:
code: 91 # ShutdownInProgress
errorLabels: [RetryableWriteError]
- name: insertOne
object: *collection
arguments:
Expand All @@ -63,7 +63,8 @@ tests:
reply:
ok: 1
n: 1
writeConcernError: { code: 91, errorLabels: [ "RetryableWriteError" ] }
errorLabels: [ "RetryableWriteError" ]
writeConcernError: { code: 91 }
commandName: insert
- commandStartedEvent:
command:
Expand Down
Loading