...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/changeStreams-db.coll.watch.yml

Documentation: go.mongodb.org/mongo-driver/testdata/retryable-reads

     1runOn:
     2    -
     3        minServerVersion: "4.0"
     4        topology: ["replicaset"]
     5    -
     6        minServerVersion: "4.1.7"
     7        topology: ["sharded", "load-balanced"]
     8        serverless: "forbid"
     9
    10database_name: &database_name "retryable-reads-tests"
    11collection_name: &collection_name "coll"
    12
    13data:
    14    - {_id: 1, x: 11}
    15
    16tests:
    17    -
    18        description: "db.coll.watch succeeds on first attempt"
    19        operations:
    20            - &retryable_operation
    21                name: watch
    22                object: collection
    23        expectations:
    24            - &retryable_command_started_event
    25                command_started_event:
    26                    command:
    27                        aggregate: *collection_name
    28                        cursor: {}
    29                        pipeline: [ { $changeStream: { } } ]
    30                    database_name: *database_name
    31    -
    32        description: "db.coll.watch succeeds on second attempt"
    33        failPoint:  &failCommand_failPoint
    34            configureFailPoint: failCommand
    35            mode: { times: 1 }
    36            data:
    37                failCommands:
    38                        - aggregate
    39                closeConnection: true
    40        operations: [*retryable_operation]
    41        expectations:
    42             - *retryable_command_started_event
    43             - *retryable_command_started_event
    44    -
    45        description: "db.coll.watch fails on first attempt"
    46        clientOptions:
    47            retryReads: false
    48        failPoint: *failCommand_failPoint
    49        operations:
    50            - &retryable_operation_fails
    51                <<: *retryable_operation
    52                error: true
    53        expectations:
    54             - *retryable_command_started_event
    55    -
    56        description: "db.coll.watch fails on second attempt"
    57        failPoint:
    58            <<: *failCommand_failPoint
    59            mode: { times: 2 }
    60        operations: [*retryable_operation_fails]
    61        expectations:
    62             - *retryable_command_started_event
    63             - *retryable_command_started_event
    64
    65
    66

View as plain text