Skip to content

Sync spec tests #750

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 2 commits into from
May 28, 2020
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
110 changes: 110 additions & 0 deletions tests/SpecTests/crud/bulkWrite-arrayFilters-clientError.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"runOn": [
{
"maxServerVersion": "3.5.5"
}
],
"data": [
{
"_id": 1,
"y": [
{
"b": 3
},
{
"b": 1
}
]
},
{
"_id": 2,
"y": [
{
"b": 0
},
{
"b": 1
}
]
}
],
"tests": [
{
"description": "BulkWrite on server that doesn't support arrayFilters",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"filter": {},
"update": {
"$set": {
"y.0.b": 2
}
},
"arrayFilters": [
{
"i.b": 1
}
]
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": []
},
{
"description": "BulkWrite on server that doesn't support arrayFilters with arrayFilters on second op",
"operations": [
{
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "updateOne",
"arguments": {
"filter": {},
"update": {
"$set": {
"y.0.b": 2
}
}
}
},
{
"name": "updateMany",
"arguments": {
"filter": {},
"update": {
"$set": {
"y.$[i].b": 2
}
},
"arrayFilters": [
{
"i.b": 1
}
]
}
}
],
"options": {
"ordered": true
}
},
"error": true
}
],
"expectations": []
}
]
}
106 changes: 105 additions & 1 deletion tests/SpecTests/transactions/error-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand Down Expand Up @@ -223,6 +224,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand Down Expand Up @@ -312,6 +314,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand Down Expand Up @@ -462,7 +465,7 @@
}
},
{
"description": "add TransientTransactionError label to connection errors",
"description": "add TransientTransactionError label to connection errors, but do not add RetryableWriteError label",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -497,6 +500,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand All @@ -512,6 +516,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand All @@ -534,6 +539,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand All @@ -550,6 +556,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
Expand Down Expand Up @@ -1098,6 +1105,103 @@
}
}
},
{
"description": "do not add RetryableWriteError label to writeConcernError ShutdownInProgress that occurs within transaction",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
}
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"writeConcern": {
"w": "majority"
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"errorLabelsContain": [],
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
}
},
{
"name": "abortTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false
},
"command_name": "abortTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": []
}
}
},
{
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
"failPoint": {
Expand Down