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      ]
15    }
16  ],
17  "database_name": "retryable-reads-tests",
18  "collection_name": "coll",
19  "data": [],
20  "tests": [
21    {
22      "description": "ListCollectionObjects succeeds after InterruptedAtShutdown",
23      "failPoint": {
24        "configureFailPoint": "failCommand",
25        "mode": {
26          "times": 1
27        },
28        "data": {
29          "failCommands": [
30            "listCollections"
31          ],
32          "errorCode": 11600
33        }
34      },
35      "operations": [
36        {
37          "name": "listCollectionObjects",
38          "object": "database"
39        }
40      ],
41      "expectations": [
42        {
43          "command_started_event": {
44            "command": {
45              "listCollections": 1
46            }
47          }
48        },
49        {
50          "command_started_event": {
51            "command": {
52              "listCollections": 1
53            }
54          }
55        }
56      ]
57    },
58    {
59      "description": "ListCollectionObjects succeeds after InterruptedDueToReplStateChange",
60      "failPoint": {
61        "configureFailPoint": "failCommand",
62        "mode": {
63          "times": 1
64        },
65        "data": {
66          "failCommands": [
67            "listCollections"
68          ],
69          "errorCode": 11602
70        }
71      },
72      "operations": [
73        {
74          "name": "listCollectionObjects",
75          "object": "database"
76        }
77      ],
78      "expectations": [
79        {
80          "command_started_event": {
81            "command": {
82              "listCollections": 1
83            }
84          }
85        },
86        {
87          "command_started_event": {
88            "command": {
89              "listCollections": 1
90            }
91          }
92        }
93      ]
94    },
95    {
96      "description": "ListCollectionObjects succeeds after NotMaster",
97      "failPoint": {
98        "configureFailPoint": "failCommand",
99        "mode": {
100          "times": 1
101        },
102        "data": {
103          "failCommands": [
104            "listCollections"
105          ],
106          "errorCode": 10107
107        }
108      },
109      "operations": [
110        {
111          "name": "listCollectionObjects",
112          "object": "database"
113        }
114      ],
115      "expectations": [
116        {
117          "command_started_event": {
118            "command": {
119              "listCollections": 1
120            }
121          }
122        },
123        {
124          "command_started_event": {
125            "command": {
126              "listCollections": 1
127            }
128          }
129        }
130      ]
131    },
132    {
133      "description": "ListCollectionObjects succeeds after NotMasterNoSlaveOk",
134      "failPoint": {
135        "configureFailPoint": "failCommand",
136        "mode": {
137          "times": 1
138        },
139        "data": {
140          "failCommands": [
141            "listCollections"
142          ],
143          "errorCode": 13435
144        }
145      },
146      "operations": [
147        {
148          "name": "listCollectionObjects",
149          "object": "database"
150        }
151      ],
152      "expectations": [
153        {
154          "command_started_event": {
155            "command": {
156              "listCollections": 1
157            }
158          }
159        },
160        {
161          "command_started_event": {
162            "command": {
163              "listCollections": 1
164            }
165          }
166        }
167      ]
168    },
169    {
170      "description": "ListCollectionObjects succeeds after NotMasterOrSecondary",
171      "failPoint": {
172        "configureFailPoint": "failCommand",
173        "mode": {
174          "times": 1
175        },
176        "data": {
177          "failCommands": [
178            "listCollections"
179          ],
180          "errorCode": 13436
181        }
182      },
183      "operations": [
184        {
185          "name": "listCollectionObjects",
186          "object": "database"
187        }
188      ],
189      "expectations": [
190        {
191          "command_started_event": {
192            "command": {
193              "listCollections": 1
194            }
195          }
196        },
197        {
198          "command_started_event": {
199            "command": {
200              "listCollections": 1
201            }
202          }
203        }
204      ]
205    },
206    {
207      "description": "ListCollectionObjects succeeds after PrimarySteppedDown",
208      "failPoint": {
209        "configureFailPoint": "failCommand",
210        "mode": {
211          "times": 1
212        },
213        "data": {
214          "failCommands": [
215            "listCollections"
216          ],
217          "errorCode": 189
218        }
219      },
220      "operations": [
221        {
222          "name": "listCollectionObjects",
223          "object": "database"
224        }
225      ],
226      "expectations": [
227        {
228          "command_started_event": {
229            "command": {
230              "listCollections": 1
231            }
232          }
233        },
234        {
235          "command_started_event": {
236            "command": {
237              "listCollections": 1
238            }
239          }
240        }
241      ]
242    },
243    {
244      "description": "ListCollectionObjects succeeds after ShutdownInProgress",
245      "failPoint": {
246        "configureFailPoint": "failCommand",
247        "mode": {
248          "times": 1
249        },
250        "data": {
251          "failCommands": [
252            "listCollections"
253          ],
254          "errorCode": 91
255        }
256      },
257      "operations": [
258        {
259          "name": "listCollectionObjects",
260          "object": "database"
261        }
262      ],
263      "expectations": [
264        {
265          "command_started_event": {
266            "command": {
267              "listCollections": 1
268            }
269          }
270        },
271        {
272          "command_started_event": {
273            "command": {
274              "listCollections": 1
275            }
276          }
277        }
278      ]
279    },
280    {
281      "description": "ListCollectionObjects succeeds after HostNotFound",
282      "failPoint": {
283        "configureFailPoint": "failCommand",
284        "mode": {
285          "times": 1
286        },
287        "data": {
288          "failCommands": [
289            "listCollections"
290          ],
291          "errorCode": 7
292        }
293      },
294      "operations": [
295        {
296          "name": "listCollectionObjects",
297          "object": "database"
298        }
299      ],
300      "expectations": [
301        {
302          "command_started_event": {
303            "command": {
304              "listCollections": 1
305            }
306          }
307        },
308        {
309          "command_started_event": {
310            "command": {
311              "listCollections": 1
312            }
313          }
314        }
315      ]
316    },
317    {
318      "description": "ListCollectionObjects succeeds after HostUnreachable",
319      "failPoint": {
320        "configureFailPoint": "failCommand",
321        "mode": {
322          "times": 1
323        },
324        "data": {
325          "failCommands": [
326            "listCollections"
327          ],
328          "errorCode": 6
329        }
330      },
331      "operations": [
332        {
333          "name": "listCollectionObjects",
334          "object": "database"
335        }
336      ],
337      "expectations": [
338        {
339          "command_started_event": {
340            "command": {
341              "listCollections": 1
342            }
343          }
344        },
345        {
346          "command_started_event": {
347            "command": {
348              "listCollections": 1
349            }
350          }
351        }
352      ]
353    },
354    {
355      "description": "ListCollectionObjects succeeds after NetworkTimeout",
356      "failPoint": {
357        "configureFailPoint": "failCommand",
358        "mode": {
359          "times": 1
360        },
361        "data": {
362          "failCommands": [
363            "listCollections"
364          ],
365          "errorCode": 89
366        }
367      },
368      "operations": [
369        {
370          "name": "listCollectionObjects",
371          "object": "database"
372        }
373      ],
374      "expectations": [
375        {
376          "command_started_event": {
377            "command": {
378              "listCollections": 1
379            }
380          }
381        },
382        {
383          "command_started_event": {
384            "command": {
385              "listCollections": 1
386            }
387          }
388        }
389      ]
390    },
391    {
392      "description": "ListCollectionObjects succeeds after SocketException",
393      "failPoint": {
394        "configureFailPoint": "failCommand",
395        "mode": {
396          "times": 1
397        },
398        "data": {
399          "failCommands": [
400            "listCollections"
401          ],
402          "errorCode": 9001
403        }
404      },
405      "operations": [
406        {
407          "name": "listCollectionObjects",
408          "object": "database"
409        }
410      ],
411      "expectations": [
412        {
413          "command_started_event": {
414            "command": {
415              "listCollections": 1
416            }
417          }
418        },
419        {
420          "command_started_event": {
421            "command": {
422              "listCollections": 1
423            }
424          }
425        }
426      ]
427    },
428    {
429      "description": "ListCollectionObjects fails after two NotMaster errors",
430      "failPoint": {
431        "configureFailPoint": "failCommand",
432        "mode": {
433          "times": 2
434        },
435        "data": {
436          "failCommands": [
437            "listCollections"
438          ],
439          "errorCode": 10107
440        }
441      },
442      "operations": [
443        {
444          "name": "listCollectionObjects",
445          "object": "database",
446          "error": true
447        }
448      ],
449      "expectations": [
450        {
451          "command_started_event": {
452            "command": {
453              "listCollections": 1
454            }
455          }
456        },
457        {
458          "command_started_event": {
459            "command": {
460              "listCollections": 1
461            }
462          }
463        }
464      ]
465    },
466    {
467      "description": "ListCollectionObjects fails after NotMaster when retryReads is false",
468      "clientOptions": {
469        "retryReads": false
470      },
471      "failPoint": {
472        "configureFailPoint": "failCommand",
473        "mode": {
474          "times": 1
475        },
476        "data": {
477          "failCommands": [
478            "listCollections"
479          ],
480          "errorCode": 10107
481        }
482      },
483      "operations": [
484        {
485          "name": "listCollectionObjects",
486          "object": "database",
487          "error": true
488        }
489      ],
490      "expectations": [
491        {
492          "command_started_event": {
493            "command": {
494              "listCollections": 1
495            }
496          }
497        }
498      ]
499    }
500  ]
501}
502