...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/updateOne-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: "UpdateOne succeeds after PrimarySteppedDown"
    16        failPoint:
    17            configureFailPoint: failCommand
    18            mode: { times: 1 }
    19            data:
    20                failCommands: ["update"]
    21                errorCode: 189
    22                errorLabels: ["RetryableWriteError"]
    23        operation:
    24            name: "updateOne"
    25            arguments:
    26                filter: { _id: 1 }
    27                update: { $inc: { x : 1 }}
    28        outcome:
    29            result:
    30                matchedCount: 1
    31                modifiedCount: 1
    32                upsertedCount: 0
    33            collection:
    34                data:
    35                    - { _id: 1, x: 12 }
    36                    - { _id: 2, x: 22 }
    37    -
    38        description: "UpdateOne succeeds after WriteConcernError ShutdownInProgress"
    39        failPoint:
    40            configureFailPoint: failCommand
    41            mode: { times: 1 }
    42            data:
    43                failCommands: ["update"]
    44                writeConcernError:
    45                    code: 91
    46                    errmsg: Replication is being shut down
    47                    errorLabels: ["RetryableWriteError"]
    48        operation:
    49            name: "updateOne"
    50            arguments:
    51                filter: { _id: 1 }
    52                update: { $inc: { x : 1 }}
    53        outcome:
    54            result:
    55                matchedCount: 1
    56                modifiedCount: 1
    57                upsertedCount: 0
    58            collection:
    59                data:
    60                    - { _id: 1, x: 12 }
    61                    - { _id: 2, x: 22 }
    62    -
    63        description: "UpdateOne fails with a RetryableWriteError label after two connection failures"
    64        failPoint:
    65            configureFailPoint: failCommand
    66            mode: { times: 2 }
    67            data:
    68                failCommands: ["update"]
    69                closeConnection: true
    70        operation:
    71            name: "updateOne"
    72            arguments:
    73                filter: { _id: 1 }
    74                update: { $inc: { x: 1 } }
    75        outcome:
    76            error: true
    77            result:
    78                errorLabelsContain: ["RetryableWriteError"]
    79            collection:
    80                data:
    81                    - { _id: 1, x: 11 }
    82                    - { _id: 2, x: 22 }

View as plain text