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

1134 lines
28 KiB
JSON

{
"description": "countDocuments-serverErrors",
"schemaVersion": "1.9",
"runOnRequirements": [
{
"minServerVersion": "4.0",
"topologies": [
"single",
"replicaset"
]
},
{
"minServerVersion": "4.1.7",
"topologies": [
"sharded",
"load-balanced"
]
}
],
"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": "CountDocuments succeeds after InterruptedAtShutdown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 11600
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after InterruptedDueToReplStateChange",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 11602
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after NotWritablePrimary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after NotPrimaryNoSecondaryOk",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 13435
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after NotPrimaryOrSecondary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 13436
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after PrimarySteppedDown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 189
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after ShutdownInProgress",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 91
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after HostNotFound",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 7
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after HostUnreachable",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 6
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after NetworkTimeout",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 89
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments succeeds after SocketException",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 9001
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectResult": 2
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments fails after two NotWritablePrimary errors",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"aggregate"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection0",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
},
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
},
{
"description": "CountDocuments 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": [
"aggregate"
],
"errorCode": 10107
}
}
}
},
{
"object": "collection1",
"name": "countDocuments",
"arguments": {
"filter": {}
},
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client1",
"events": [
{
"commandStartedEvent": {
"command": {
"aggregate": "coll",
"pipeline": [
{
"$match": {}
},
{
"$group": {
"_id": 1,
"n": {
"$sum": 1
}
}
}
]
},
"databaseName": "retryable-reads-tests"
}
}
]
}
]
}
]
}