{
  "runOn": [
    {
      "minServerVersion": "4.4"
    }
  ],
  "database_name": "sdam-tests",
  "collection_name": "find-shutdown-error",
  "data": [],
  "tests": [
    {
      "description": "Concurrent shutdown error on find",
      "clientOptions": {
        "retryWrites": false,
        "retryReads": false,
        "heartbeatFrequencyMS": 500,
        "appname": "shutdownErrorFindTest"
      },
      "operations": [
        {
          "name": "insertOne",
          "object": "collection",
          "arguments": {
            "document": {
              "_id": 1
            }
          }
        },
        {
          "name": "configureFailPoint",
          "object": "testRunner",
          "arguments": {
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 2
              },
              "data": {
                "failCommands": [
                  "find"
                ],
                "appName": "shutdownErrorFindTest",
                "errorCode": 91,
                "blockConnection": true,
                "blockTimeMS": 500
              }
            }
          }
        },
        {
          "name": "startThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread1"
          }
        },
        {
          "name": "startThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread2"
          }
        },
        {
          "name": "runOnThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread1",
            "operation": {
              "name": "find",
              "object": "collection",
              "arguments": {
                "filter": {
                  "_id": 1
                }
              },
              "error": true
            }
          }
        },
        {
          "name": "runOnThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread2",
            "operation": {
              "name": "find",
              "object": "collection",
              "arguments": {
                "filter": {
                  "_id": 1
                }
              },
              "error": true
            }
          }
        },
        {
          "name": "waitForThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread1"
          }
        },
        {
          "name": "waitForThread",
          "object": "testRunner",
          "arguments": {
            "name": "thread2"
          }
        },
        {
          "name": "waitForEvent",
          "object": "testRunner",
          "arguments": {
            "event": "ServerMarkedUnknownEvent",
            "count": 1
          }
        },
        {
          "name": "waitForEvent",
          "object": "testRunner",
          "arguments": {
            "event": "PoolClearedEvent",
            "count": 1
          }
        },
        {
          "name": "insertOne",
          "object": "collection",
          "arguments": {
            "document": {
              "_id": 4
            }
          }
        },
        {
          "name": "assertEventCount",
          "object": "testRunner",
          "arguments": {
            "event": "ServerMarkedUnknownEvent",
            "count": 1
          }
        },
        {
          "name": "assertEventCount",
          "object": "testRunner",
          "arguments": {
            "event": "PoolClearedEvent",
            "count": 1
          }
        }
      ],
      "outcome": {
        "collection": {
          "data": [
            {
              "_id": 1
            },
            {
              "_id": 4
            }
          ]
        }
      }
    }
  ]
}
