bson/testdata/retryable-writes/legacy/updateOne-errorLabels.json
2025-03-17 20:58:26 +01:00

124 lines
2.2 KiB
JSON

{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded",
"load-balanced"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "UpdateOne succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
},
"outcome": {
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
},
"collection": {
"data": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "UpdateOne fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}