...

Text file src/go.mongodb.org/mongo-driver/testdata/server-selection/logging/load-balanced.json

Documentation: go.mongodb.org/mongo-driver/testdata/server-selection/logging

     1{
     2  "description": "server-selection-logging",
     3  "schemaVersion": "1.13",
     4  "runOnRequirements": [
     5    {
     6      "topologies": [
     7        "load-balanced"
     8      ]
     9    }
    10  ],
    11  "createEntities": [
    12    {
    13      "client": {
    14        "id": "client",
    15        "uriOptions": {
    16          "heartbeatFrequencyMS": 500
    17        },
    18        "observeLogMessages": {
    19          "serverSelection": "debug"
    20        },
    21        "observeEvents": [
    22          "serverDescriptionChangedEvent"
    23        ]
    24      }
    25    },
    26    {
    27      "database": {
    28        "id": "database",
    29        "client": "client",
    30        "databaseName": "logging-tests"
    31      }
    32    },
    33    {
    34      "collection": {
    35        "id": "collection",
    36        "database": "database",
    37        "collectionName": "server-selection"
    38      }
    39    }
    40  ],
    41  "tests": [
    42    {
    43      "description": "A successful operation - load balanced cluster",
    44      "operations": [
    45        {
    46          "name": "waitForEvent",
    47          "object": "testRunner",
    48          "arguments": {
    49            "client": "client",
    50            "event": {
    51              "serverDescriptionChangedEvent": {
    52                "newDescription": {
    53                  "type": "LoadBalancer"
    54                }
    55              }
    56            },
    57            "count": 1
    58          }
    59        },
    60        {
    61          "name": "insertOne",
    62          "object": "collection",
    63          "arguments": {
    64            "document": {
    65              "x": 1
    66            }
    67          }
    68        }
    69      ],
    70      "expectLogMessages": [
    71        {
    72          "client": "client",
    73          "messages": [
    74            {
    75              "level": "debug",
    76              "component": "serverSelection",
    77              "data": {
    78                "message": "Server selection started",
    79                "selector": {
    80                  "$$exists": true
    81                },
    82                "operation": "insert",
    83                "topologyDescription": {
    84                  "$$exists": true
    85                }
    86              }
    87            },
    88            {
    89              "level": "debug",
    90              "component": "serverSelection",
    91              "data": {
    92                "message": "Server selection succeeded",
    93                "selector": {
    94                  "$$exists": true
    95                },
    96                "operation": "insert",
    97                "topologyDescription": {
    98                  "$$exists": true
    99                }
   100              }
   101            }
   102          ]
   103        }
   104      ]
   105    }
   106  ]
   107}

View as plain text