...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/findOneAndDelete-serverErrors.yml

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

     1runOn:
     2    -
     3        minServerVersion: "4.0"
     4        topology: ["replicaset"]
     5    -
     6        minServerVersion: "4.1.7"
     7        topology: ["sharded", "load-balanced"]
     8
     9data:
    10    - { _id: 1, x: 11 }
    11    - { _id: 2, x: 22 }
    12
    13tests:
    14    -
    15        description: "FindOneAndDelete succeeds after PrimarySteppedDown"
    16        failPoint:
    17            configureFailPoint: failCommand
    18            mode: { times: 1 }
    19            data:
    20                failCommands: ["findAndModify"]
    21                errorCode: 189
    22                errorLabels: ["RetryableWriteError"]
    23        operation:
    24            name: "findOneAndDelete"
    25            arguments:
    26                filter: { x: { $gte: 11 }}
    27                sort: { x: 1 }
    28        outcome:
    29            result: { _id: 1, x: 11 }
    30            collection:
    31                data:
    32                    - { _id: 2, x: 22 }
    33    -
    34        description: "FindOneAndDelete succeeds after WriteConcernError ShutdownInProgress"
    35        failPoint:
    36            configureFailPoint: failCommand
    37            mode: { times: 1 }
    38            data:
    39                failCommands: ["findAndModify"]
    40                writeConcernError:
    41                    code: 91
    42                    errmsg: Replication is being shut down
    43                    errorLabels: ["RetryableWriteError"]
    44        operation:
    45            name: "findOneAndDelete"
    46            arguments:
    47                filter: { x: { $gte: 11 }}
    48                sort: { x: 1 }
    49        outcome:
    50            result: { _id: 1, x: 11 }
    51            collection:
    52                data:
    53                    - { _id: 2, x: 22 }
    54    -
    55        description: "FindOneAndDelete fails with a RetryableWriteError label after two connection failures"
    56        failPoint:
    57            configureFailPoint: failCommand
    58            mode: { times: 2 }
    59            data:
    60                failCommands: ["findAndModify"]
    61                closeConnection: true
    62        operation:
    63            name: "findOneAndDelete"
    64            arguments:
    65                filter: { x: { $gte: 11 } }
    66                sort: { x: 1 }
    67        outcome:
    68            error: true
    69            result:
    70                errorLabelsContain: ["RetryableWriteError"]
    71            collection:
    72                data:
    73                    - { _id: 1, x: 11 }
    74                    - { _id: 2, x: 22 }

View as plain text