mongo-python-driver/test/retryable_reads/unified/estimatedDocumentCount-serverErrors.json

769 lines
18 KiB
JSON

{
"description": "estimatedDocumentCount-serverErrors",
"schemaVersion": "1.9",
"runOnRequirements": [
{
"minServerVersion": "4.0",
"topologies": [
"single",
"replicaset"
]
},
{
"minServerVersion": "4.1.7",
"topologies": [
"sharded"
]
}
],
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "retryable-reads-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll"
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "retryable-reads-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
],
"tests": [
{
"description": "EstimatedDocumentCount succeeds after InterruptedAtShutdown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 11600
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 11602
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after NotWritablePrimary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 13435
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after NotPrimaryOrSecondary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 13436
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after PrimarySteppedDown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 189
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after ShutdownInProgress",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 91
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after HostNotFound",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 7
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after HostUnreachable",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 6
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after NetworkTimeout",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 89
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount succeeds after SocketException",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 9001
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount fails after two NotWritablePrimary errors",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"count"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection0",
"name": "estimatedDocumentCount",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false",
"operations": [
{
"object": "testRunner",
"name": "createEntities",
"arguments": {
"entities": [
{
"client": {
"id": "client1",
"useMultipleMongoses": false,
"uriOptions": {
"retryReads": false
},
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database1",
"client": "client1",
"databaseName": "retryable-reads-tests"
}
},
{
"collection": {
"id": "collection1",
"database": "database1",
"collectionName": "coll"
}
}
]
}
},
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client1",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"count"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection1",
"name": "estimatedDocumentCount",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client1",
"events": [
{
"commandStartedEvent": {
"command": {
"count": "coll"
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
}
]
}