...

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

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

     1runOn:
     2    -
     3        minServerVersion: "3.6"
     4        topology: ["replicaset"]
     5
     6data:
     7    - { _id: 1, x: 11 }
     8    - { _id: 2, x: 22 }
     9
    10tests:
    11    -
    12        description: "DeleteOne is committed on first attempt"
    13        failPoint:
    14            configureFailPoint: onPrimaryTransactionalWrite
    15            mode: { times: 1 }
    16        operation:
    17            name: "deleteOne"
    18            arguments:
    19                filter: { _id: 1 }
    20        outcome:
    21            result:
    22                deletedCount: 1
    23            collection:
    24                data:
    25                    - { _id: 2, x: 22 }
    26    -
    27        description: "DeleteOne is not committed on first attempt"
    28        failPoint:
    29            configureFailPoint: onPrimaryTransactionalWrite
    30            mode: { times: 1 }
    31            data: { failBeforeCommitExceptionCode: 1 }
    32        operation:
    33            name: "deleteOne"
    34            arguments:
    35                filter: { _id: 1 }
    36        outcome:
    37            result:
    38                deletedCount: 1
    39            collection:
    40                data:
    41                    - { _id: 2, x: 22 }
    42    -
    43        description: "DeleteOne is never committed"
    44        failPoint:
    45            configureFailPoint: onPrimaryTransactionalWrite
    46            mode: { times: 2 }
    47            data: { failBeforeCommitExceptionCode: 1 }
    48        operation:
    49            name: "deleteOne"
    50            arguments:
    51                filter: { _id: 1 }
    52        outcome:
    53            error: true
    54            collection:
    55                data:
    56                    - { _id: 1, x: 11 }
    57                    - { _id: 2, x: 22 }

View as plain text