...

Text file src/go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/integration/insert-network-error.json

Documentation: go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/integration

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.4"
     5    }
     6  ],
     7  "database_name": "sdam-tests",
     8  "collection_name": "insert-network-error",
     9  "data": [
    10    {
    11      "_id": 1
    12    },
    13    {
    14      "_id": 2
    15    }
    16  ],
    17  "tests": [
    18    {
    19      "description": "Reset server and pool after network error on insert",
    20      "failPoint": {
    21        "configureFailPoint": "failCommand",
    22        "mode": {
    23          "times": 1
    24        },
    25        "data": {
    26          "failCommands": [
    27            "insert"
    28          ],
    29          "closeConnection": true,
    30          "appName": "insertNetworkErrorTest"
    31        }
    32      },
    33      "clientOptions": {
    34        "retryWrites": false,
    35        "appname": "insertNetworkErrorTest"
    36      },
    37      "operations": [
    38        {
    39          "name": "insertMany",
    40          "object": "collection",
    41          "arguments": {
    42            "documents": [
    43              {
    44                "_id": 3
    45              },
    46              {
    47                "_id": 4
    48              }
    49            ]
    50          },
    51          "error": true
    52        },
    53        {
    54          "name": "waitForEvent",
    55          "object": "testRunner",
    56          "arguments": {
    57            "event": "ServerMarkedUnknownEvent",
    58            "count": 1
    59          }
    60        },
    61        {
    62          "name": "waitForEvent",
    63          "object": "testRunner",
    64          "arguments": {
    65            "event": "PoolClearedEvent",
    66            "count": 1
    67          }
    68        },
    69        {
    70          "name": "insertMany",
    71          "object": "collection",
    72          "arguments": {
    73            "documents": [
    74              {
    75                "_id": 5
    76              },
    77              {
    78                "_id": 6
    79              }
    80            ]
    81          }
    82        },
    83        {
    84          "name": "assertEventCount",
    85          "object": "testRunner",
    86          "arguments": {
    87            "event": "ServerMarkedUnknownEvent",
    88            "count": 1
    89          }
    90        },
    91        {
    92          "name": "assertEventCount",
    93          "object": "testRunner",
    94          "arguments": {
    95            "event": "PoolClearedEvent",
    96            "count": 1
    97          }
    98        }
    99      ],
   100      "expectations": [
   101        {
   102          "command_started_event": {
   103            "command": {
   104              "insert": "insert-network-error",
   105              "documents": [
   106                {
   107                  "_id": 3
   108                },
   109                {
   110                  "_id": 4
   111                }
   112              ]
   113            },
   114            "command_name": "insert",
   115            "database_name": "sdam-tests"
   116          }
   117        },
   118        {
   119          "command_started_event": {
   120            "command": {
   121              "insert": "insert-network-error",
   122              "documents": [
   123                {
   124                  "_id": 5
   125                },
   126                {
   127                  "_id": 6
   128                }
   129              ]
   130            },
   131            "command_name": "insert",
   132            "database_name": "sdam-tests"
   133          }
   134        }
   135      ],
   136      "outcome": {
   137        "collection": {
   138          "data": [
   139            {
   140              "_id": 1
   141            },
   142            {
   143              "_id": 2
   144            },
   145            {
   146              "_id": 5
   147            },
   148            {
   149              "_id": 6
   150            }
   151          ]
   152        }
   153      }
   154    }
   155  ]
   156}

View as plain text