{
  "description": "timeoutMS can be configured on a MongoClient",
  "schemaVersion": "1.5",
  "runOnRequirements": [
    {
      "minServerVersion": "4.4",
      "topologies": [
        "replicaset",
        "sharded-replicaset"
      ]
    }
  ],
  "createEntities": [
    {
      "client": {
        "id": "failPointClient",
        "useMultipleMongoses": false
      }
    }
  ],
  "initialData": [
    {
      "collectionName": "coll",
      "databaseName": "test",
      "documents": []
    }
  ],
  "tests": [
    {
      "description": "timeoutMS can be configured on a MongoClient - listDatabases on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listDatabases"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listDatabases",
          "object": "client",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listDatabases",
                "databaseName": "admin",
                "command": {
                  "listDatabases": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listDatabases on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listDatabases"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listDatabases",
          "object": "client",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listDatabases",
                "databaseName": "admin",
                "command": {
                  "listDatabases": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - listDatabaseNames on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listDatabases"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listDatabaseNames",
          "object": "client",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listDatabases",
                "databaseName": "admin",
                "command": {
                  "listDatabases": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listDatabaseNames on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listDatabases"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listDatabaseNames",
          "object": "client",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listDatabases",
                "databaseName": "admin",
                "command": {
                  "listDatabases": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - createChangeStream on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "client",
          "arguments": {
            "pipeline": []
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "admin",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on client",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "client",
          "arguments": {
            "pipeline": []
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "admin",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - aggregate on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "aggregate",
          "object": "database",
          "arguments": {
            "pipeline": [
              {
                "$listLocalSessions": {}
              },
              {
                "$limit": 1
              }
            ]
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - aggregate on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "aggregate",
          "object": "database",
          "arguments": {
            "pipeline": [
              {
                "$listLocalSessions": {}
              },
              {
                "$limit": 1
              }
            ]
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - listCollections on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listCollections"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listCollections",
          "object": "database",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listCollections",
                "databaseName": "test",
                "command": {
                  "listCollections": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listCollections on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listCollections"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listCollections",
          "object": "database",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listCollections",
                "databaseName": "test",
                "command": {
                  "listCollections": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - listCollectionNames on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listCollections"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listCollectionNames",
          "object": "database",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listCollections",
                "databaseName": "test",
                "command": {
                  "listCollections": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listCollectionNames on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listCollections"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listCollectionNames",
          "object": "database",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listCollections",
                "databaseName": "test",
                "command": {
                  "listCollections": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - runCommand on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "ping"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "runCommand",
          "object": "database",
          "arguments": {
            "command": {
              "ping": 1
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "ping",
                "databaseName": "test",
                "command": {
                  "ping": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - runCommand on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "ping"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "runCommand",
          "object": "database",
          "arguments": {
            "command": {
              "ping": 1
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "ping",
                "databaseName": "test",
                "command": {
                  "ping": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - createChangeStream on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "database",
          "arguments": {
            "pipeline": []
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on database",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "database",
          "arguments": {
            "pipeline": []
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": 1,
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - aggregate on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "aggregate",
          "object": "collection",
          "arguments": {
            "pipeline": []
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - aggregate on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "aggregate",
          "object": "collection",
          "arguments": {
            "pipeline": []
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - count on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "count"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "count",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "count",
                "databaseName": "test",
                "command": {
                  "count": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - count on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "count"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "count",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "count",
                "databaseName": "test",
                "command": {
                  "count": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - countDocuments on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "countDocuments",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - countDocuments on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "countDocuments",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - estimatedDocumentCount on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "count"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "estimatedDocumentCount",
          "object": "collection",
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "count",
                "databaseName": "test",
                "command": {
                  "count": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - estimatedDocumentCount on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "count"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "estimatedDocumentCount",
          "object": "collection"
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "count",
                "databaseName": "test",
                "command": {
                  "count": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - distinct on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "distinct"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "distinct",
          "object": "collection",
          "arguments": {
            "fieldName": "x",
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "distinct",
                "databaseName": "test",
                "command": {
                  "distinct": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - distinct on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "distinct"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "distinct",
          "object": "collection",
          "arguments": {
            "fieldName": "x",
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "distinct",
                "databaseName": "test",
                "command": {
                  "distinct": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - find on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "find"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "find",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "find",
                "databaseName": "test",
                "command": {
                  "find": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - find on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "find"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "find",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "find",
                "databaseName": "test",
                "command": {
                  "find": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - findOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "find"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "findOne",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "find",
                "databaseName": "test",
                "command": {
                  "find": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - findOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "find"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "findOne",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "find",
                "databaseName": "test",
                "command": {
                  "find": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - listIndexes on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listIndexes",
          "object": "collection",
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listIndexes",
                "databaseName": "test",
                "command": {
                  "listIndexes": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listIndexes on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listIndexes",
          "object": "collection"
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listIndexes",
                "databaseName": "test",
                "command": {
                  "listIndexes": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - listIndexNames on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "listIndexNames",
          "object": "collection",
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listIndexes",
                "databaseName": "test",
                "command": {
                  "listIndexes": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - listIndexNames on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "listIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "listIndexNames",
          "object": "collection"
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "listIndexes",
                "databaseName": "test",
                "command": {
                  "listIndexes": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - createChangeStream on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "collection",
          "arguments": {
            "pipeline": []
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "aggregate"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "createChangeStream",
          "object": "collection",
          "arguments": {
            "pipeline": []
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "aggregate",
                "databaseName": "test",
                "command": {
                  "aggregate": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - insertOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "insertOne",
          "object": "collection",
          "arguments": {
            "document": {
              "x": 1
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - insertOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "insertOne",
          "object": "collection",
          "arguments": {
            "document": {
              "x": 1
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - insertMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "insertMany",
          "object": "collection",
          "arguments": {
            "documents": [
              {
                "x": 1
              }
            ]
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - insertMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "insertMany",
          "object": "collection",
          "arguments": {
            "documents": [
              {
                "x": 1
              }
            ]
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - deleteOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "delete"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "deleteOne",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "delete",
                "databaseName": "test",
                "command": {
                  "delete": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - deleteOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "delete"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "deleteOne",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "delete",
                "databaseName": "test",
                "command": {
                  "delete": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - deleteMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "delete"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "deleteMany",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "delete",
                "databaseName": "test",
                "command": {
                  "delete": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - deleteMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "delete"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "deleteMany",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "delete",
                "databaseName": "test",
                "command": {
                  "delete": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - replaceOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "replaceOne",
          "object": "collection",
          "arguments": {
            "filter": {},
            "replacement": {
              "x": 1
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - replaceOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "replaceOne",
          "object": "collection",
          "arguments": {
            "filter": {},
            "replacement": {
              "x": 1
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - updateOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "updateOne",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - updateOne on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "updateOne",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - updateMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "updateMany",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - updateMany on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "update"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "updateMany",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "update",
                "databaseName": "test",
                "command": {
                  "update": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - findOneAndDelete on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "findOneAndDelete",
          "object": "collection",
          "arguments": {
            "filter": {}
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndDelete on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "findOneAndDelete",
          "object": "collection",
          "arguments": {
            "filter": {}
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - findOneAndReplace on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "findOneAndReplace",
          "object": "collection",
          "arguments": {
            "filter": {},
            "replacement": {
              "x": 1
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndReplace on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "findOneAndReplace",
          "object": "collection",
          "arguments": {
            "filter": {},
            "replacement": {
              "x": 1
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - findOneAndUpdate on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "findOneAndUpdate",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndUpdate on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "findAndModify"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "findOneAndUpdate",
          "object": "collection",
          "arguments": {
            "filter": {},
            "update": {
              "$set": {
                "x": 1
              }
            }
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "findAndModify",
                "databaseName": "test",
                "command": {
                  "findAndModify": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - bulkWrite on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "bulkWrite",
          "object": "collection",
          "arguments": {
            "requests": [
              {
                "insertOne": {
                  "document": {
                    "_id": 1
                  }
                }
              }
            ]
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - bulkWrite on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "insert"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "bulkWrite",
          "object": "collection",
          "arguments": {
            "requests": [
              {
                "insertOne": {
                  "document": {
                    "_id": 1
                  }
                }
              }
            ]
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "insert",
                "databaseName": "test",
                "command": {
                  "insert": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - createIndex on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "createIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "createIndex",
          "object": "collection",
          "arguments": {
            "keys": {
              "x": 1
            },
            "name": "x_1"
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "createIndexes",
                "databaseName": "test",
                "command": {
                  "createIndexes": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - createIndex on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "createIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "createIndex",
          "object": "collection",
          "arguments": {
            "keys": {
              "x": 1
            },
            "name": "x_1"
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "createIndexes",
                "databaseName": "test",
                "command": {
                  "createIndexes": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - dropIndex on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "dropIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "dropIndex",
          "object": "collection",
          "arguments": {
            "name": "x_1"
          },
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "dropIndexes",
                "databaseName": "test",
                "command": {
                  "dropIndexes": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - dropIndex on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "dropIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "dropIndex",
          "object": "collection",
          "arguments": {
            "name": "x_1"
          },
          "expectError": {
            "isClientError": false,
            "isTimeoutError": false
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "dropIndexes",
                "databaseName": "test",
                "command": {
                  "dropIndexes": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be configured on a MongoClient - dropIndexes on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 50
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "dropIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 60
              }
            }
          }
        },
        {
          "name": "dropIndexes",
          "object": "collection",
          "expectError": {
            "isTimeoutError": true
          }
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "dropIndexes",
                "databaseName": "test",
                "command": {
                  "dropIndexes": "coll",
                  "maxTimeMS": {
                    "$$type": [
                      "int",
                      "long"
                    ]
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "description": "timeoutMS can be set to 0 on a MongoClient - dropIndexes on collection",
      "operations": [
        {
          "name": "createEntities",
          "object": "testRunner",
          "arguments": {
            "entities": [
              {
                "client": {
                  "id": "client",
                  "uriOptions": {
                    "timeoutMS": 0
                  },
                  "useMultipleMongoses": false,
                  "observeEvents": [
                    "commandStartedEvent"
                  ],
                  "ignoreCommandMonitoringEvents": [
                    "killCursors"
                  ]
                }
              },
              {
                "database": {
                  "id": "database",
                  "client": "client",
                  "databaseName": "test"
                }
              },
              {
                "collection": {
                  "id": "collection",
                  "database": "database",
                  "collectionName": "coll"
                }
              }
            ]
          }
        },
        {
          "name": "failPoint",
          "object": "testRunner",
          "arguments": {
            "client": "failPointClient",
            "failPoint": {
              "configureFailPoint": "failCommand",
              "mode": {
                "times": 1
              },
              "data": {
                "failCommands": [
                  "dropIndexes"
                ],
                "blockConnection": true,
                "blockTimeMS": 15
              }
            }
          }
        },
        {
          "name": "dropIndexes",
          "object": "collection"
        }
      ],
      "expectEvents": [
        {
          "client": "client",
          "events": [
            {
              "commandStartedEvent": {
                "commandName": "dropIndexes",
                "databaseName": "test",
                "command": {
                  "dropIndexes": "coll",
                  "maxTimeMS": {
                    "$$exists": false
                  }
                }
              }
            }
          ]
        }
      ]
    }
  ]
}
