1{
2 "runOn": [
3 {
4 "minServerVersion": "4.0",
5 "topology": [
6 "single",
7 "replicaset"
8 ]
9 },
10 {
11 "minServerVersion": "4.1.7",
12 "topology": [
13 "sharded",
14 "load-balanced"
15 ]
16 }
17 ],
18 "database_name": "retryable-reads-tests",
19 "collection_name": "coll",
20 "data": [
21 {
22 "_id": 1,
23 "x": 11
24 },
25 {
26 "_id": 2,
27 "x": 22
28 }
29 ],
30 "tests": [
31 {
32 "description": "Count succeeds on first attempt",
33 "operations": [
34 {
35 "name": "count",
36 "object": "collection",
37 "arguments": {
38 "filter": {}
39 },
40 "result": 2
41 }
42 ],
43 "expectations": [
44 {
45 "command_started_event": {
46 "command": {
47 "count": "coll"
48 },
49 "database_name": "retryable-reads-tests"
50 }
51 }
52 ]
53 },
54 {
55 "description": "Count succeeds on second attempt",
56 "failPoint": {
57 "configureFailPoint": "failCommand",
58 "mode": {
59 "times": 1
60 },
61 "data": {
62 "failCommands": [
63 "count"
64 ],
65 "closeConnection": true
66 }
67 },
68 "operations": [
69 {
70 "name": "count",
71 "object": "collection",
72 "arguments": {
73 "filter": {}
74 },
75 "result": 2
76 }
77 ],
78 "expectations": [
79 {
80 "command_started_event": {
81 "command": {
82 "count": "coll"
83 },
84 "database_name": "retryable-reads-tests"
85 }
86 },
87 {
88 "command_started_event": {
89 "command": {
90 "count": "coll"
91 },
92 "database_name": "retryable-reads-tests"
93 }
94 }
95 ]
96 },
97 {
98 "description": "Count fails on first attempt",
99 "clientOptions": {
100 "retryReads": false
101 },
102 "failPoint": {
103 "configureFailPoint": "failCommand",
104 "mode": {
105 "times": 1
106 },
107 "data": {
108 "failCommands": [
109 "count"
110 ],
111 "closeConnection": true
112 }
113 },
114 "operations": [
115 {
116 "name": "count",
117 "object": "collection",
118 "arguments": {
119 "filter": {}
120 },
121 "error": true
122 }
123 ],
124 "expectations": [
125 {
126 "command_started_event": {
127 "command": {
128 "count": "coll"
129 },
130 "database_name": "retryable-reads-tests"
131 }
132 }
133 ]
134 },
135 {
136 "description": "Count fails on second attempt",
137 "failPoint": {
138 "configureFailPoint": "failCommand",
139 "mode": {
140 "times": 2
141 },
142 "data": {
143 "failCommands": [
144 "count"
145 ],
146 "closeConnection": true
147 }
148 },
149 "operations": [
150 {
151 "name": "count",
152 "object": "collection",
153 "arguments": {
154 "filter": {}
155 },
156 "error": true
157 }
158 ],
159 "expectations": [
160 {
161 "command_started_event": {
162 "command": {
163 "count": "coll"
164 },
165 "database_name": "retryable-reads-tests"
166 }
167 },
168 {
169 "command_started_event": {
170 "command": {
171 "count": "coll"
172 },
173 "database_name": "retryable-reads-tests"
174 }
175 }
176 ]
177 }
178 ]
179}
View as plain text