1runOn:
2    -
3        minServerVersion: "4.0"
4        topology: ["single", "replicaset"]
5    -
6        minServerVersion: "4.1.7"
7        topology: ["sharded"]
8
9database_name: &database_name "retryable-reads-tests"
10collection_name: &collection_name "coll"
11
12data: []
13
14tests:
15    -
16        description: "ListCollectionObjects succeeds after InterruptedAtShutdown"
17        failPoint: &failCommand_failPoint
18            configureFailPoint: failCommand
19            mode: { times: 1 }
20            data: { failCommands: [listCollections], errorCode: 11600 }
21        operations:
22            - &retryable_operation
23                name: listCollectionObjects
24                object: database
25        expectations:
26            -  &retryable_command_started_event
27                command_started_event:
28                    command:
29                        listCollections: 1
30            - *retryable_command_started_event
31    -
32        description: "ListCollectionObjects succeeds after InterruptedDueToReplStateChange"
33        failPoint:
34            <<: *failCommand_failPoint
35            data: { failCommands: [listCollections], errorCode: 11602 }
36        operations: [*retryable_operation]
37        expectations:
38             - *retryable_command_started_event
39             - *retryable_command_started_event
40    -
41        description: "ListCollectionObjects succeeds after NotMaster"
42        failPoint:
43            <<: *failCommand_failPoint
44            data: { failCommands: [listCollections], errorCode: 10107 }
45        operations: [*retryable_operation]
46        expectations:
47             - *retryable_command_started_event
48             - *retryable_command_started_event
49    -
50        description: "ListCollectionObjects succeeds after NotMasterNoSlaveOk"
51        failPoint:
52            <<: *failCommand_failPoint
53            data: { failCommands: [listCollections], errorCode: 13435 }
54        operations: [*retryable_operation]
55        expectations:
56             - *retryable_command_started_event
57             - *retryable_command_started_event
58    -
59        description: "ListCollectionObjects succeeds after NotMasterOrSecondary"
60        failPoint:
61            <<: *failCommand_failPoint
62            data: { failCommands: [listCollections], errorCode: 13436 }
63        operations: [*retryable_operation]
64        expectations:
65             - *retryable_command_started_event
66             - *retryable_command_started_event
67    -
68        description: "ListCollectionObjects succeeds after PrimarySteppedDown"
69        failPoint:
70            <<: *failCommand_failPoint
71            data: { failCommands: [listCollections], errorCode: 189 }
72        operations: [*retryable_operation]
73        expectations:
74             - *retryable_command_started_event
75             - *retryable_command_started_event
76    -
77        description: "ListCollectionObjects succeeds after ShutdownInProgress"
78        failPoint:
79            <<: *failCommand_failPoint
80            data: { failCommands: [listCollections], errorCode: 91 }
81        operations: [*retryable_operation]
82        expectations:
83             - *retryable_command_started_event
84             - *retryable_command_started_event
85    -
86        description: "ListCollectionObjects succeeds after HostNotFound"
87        failPoint:
88            <<: *failCommand_failPoint
89            data: { failCommands: [listCollections], errorCode: 7 }
90        operations: [*retryable_operation]
91        expectations:
92             - *retryable_command_started_event
93             - *retryable_command_started_event
94    -
95        description: "ListCollectionObjects succeeds after HostUnreachable"
96        failPoint:
97            <<: *failCommand_failPoint
98            data: { failCommands: [listCollections], errorCode: 6 }
99        operations: [*retryable_operation]
100        expectations:
101             - *retryable_command_started_event
102             - *retryable_command_started_event
103    -
104        description: "ListCollectionObjects succeeds after NetworkTimeout"
105        failPoint:
106            <<: *failCommand_failPoint
107            data: { failCommands: [listCollections], errorCode: 89 }
108        operations: [*retryable_operation]
109        expectations:
110             - *retryable_command_started_event
111             - *retryable_command_started_event
112    -
113        description: "ListCollectionObjects succeeds after SocketException"
114        failPoint:
115            <<: *failCommand_failPoint
116            data: { failCommands: [listCollections], errorCode: 9001 }
117        operations: [*retryable_operation]
118        expectations:
119             - *retryable_command_started_event
120             - *retryable_command_started_event
121    -
122        description: "ListCollectionObjects fails after two NotMaster errors"
123        failPoint:
124            <<: *failCommand_failPoint
125            mode: { times: 2 }
126            data: { failCommands: [listCollections], errorCode: 10107 }
127        operations:
128            - &retryable_operation_fails
129                <<: *retryable_operation
130                error: true
131        expectations:
132             - *retryable_command_started_event
133             - *retryable_command_started_event
134    -
135        description: "ListCollectionObjects fails after NotMaster when retryReads is false"
136        clientOptions:
137            retryReads: false
138        failPoint:
139            <<: *failCommand_failPoint
140            data: { failCommands: [listCollections], errorCode: 10107 }
141        operations: [*retryable_operation_fails]
142        expectations:
143             - *retryable_command_started_event
144
145