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 on first attempt"
17        operations:
18            - &retryable_operation
19                name: listCollectionObjects
20                object: database
21        expectations:
22            -  &retryable_command_started_event
23                command_started_event:
24                    command:
25                        listCollections: 1
26    -
27        description: "ListCollectionObjects succeeds on second attempt"
28        failPoint: &failCommand_failPoint
29            configureFailPoint: failCommand
30            mode: { times: 1 }
31            data:
32                failCommands:
33                        - listCollections
34                closeConnection: true
35        operations: [*retryable_operation]
36        expectations:
37             - *retryable_command_started_event
38             - *retryable_command_started_event
39    -
40        description: "ListCollectionObjects fails on first attempt"
41        clientOptions:
42            retryReads: false
43        failPoint: *failCommand_failPoint
44        operations:
45            - &retryable_operation_fails
46                <<: *retryable_operation
47                error: true
48        expectations:
49             - *retryable_command_started_event
50    -
51        description: "ListCollectionObjects fails on second attempt"
52        failPoint:
53            <<: *failCommand_failPoint
54            mode: { times: 2 }
55        operations: [*retryable_operation_fails]
56        expectations:
57             - *retryable_command_started_event
58             - *retryable_command_started_event
59
60