...
1{
2 "runOn": [
3 {
4 "minServerVersion": "4.3.1",
5 "topology": [
6 "replicaset",
7 "sharded",
8 "load-balanced"
9 ]
10 }
11 ],
12 "data": [
13 {
14 "_id": 1,
15 "x": 11
16 },
17 {
18 "_id": 2,
19 "x": 22
20 }
21 ],
22 "tests": [
23 {
24 "description": "FindOneAndUpdate succeeds with RetryableWriteError from server",
25 "failPoint": {
26 "configureFailPoint": "failCommand",
27 "mode": {
28 "times": 1
29 },
30 "data": {
31 "failCommands": [
32 "findAndModify"
33 ],
34 "errorCode": 112,
35 "errorLabels": [
36 "RetryableWriteError"
37 ]
38 }
39 },
40 "operation": {
41 "name": "findOneAndUpdate",
42 "arguments": {
43 "filter": {
44 "_id": 1
45 },
46 "update": {
47 "$inc": {
48 "x": 1
49 }
50 },
51 "returnDocument": "Before"
52 }
53 },
54 "outcome": {
55 "result": {
56 "_id": 1,
57 "x": 11
58 },
59 "collection": {
60 "data": [
61 {
62 "_id": 1,
63 "x": 12
64 },
65 {
66 "_id": 2,
67 "x": 22
68 }
69 ]
70 }
71 }
72 },
73 {
74 "description": "FindOneAndUpdate fails if server does not return RetryableWriteError",
75 "failPoint": {
76 "configureFailPoint": "failCommand",
77 "mode": {
78 "times": 1
79 },
80 "data": {
81 "failCommands": [
82 "findAndModify"
83 ],
84 "errorCode": 11600,
85 "errorLabels": []
86 }
87 },
88 "operation": {
89 "name": "findOneAndUpdate",
90 "arguments": {
91 "filter": {
92 "_id": 1
93 },
94 "update": {
95 "$inc": {
96 "x": 1
97 }
98 },
99 "returnDocument": "Before"
100 }
101 },
102 "outcome": {
103 "error": true,
104 "result": {
105 "errorLabelsOmit": [
106 "RetryableWriteError"
107 ]
108 },
109 "collection": {
110 "data": [
111 {
112 "_id": 1,
113 "x": 11
114 },
115 {
116 "_id": 2,
117 "x": 22
118 }
119 ]
120 }
121 }
122 }
123 ]
124}
View as plain text