Skip to content

Commit

Permalink
sync retryable writes test
Browse files Browse the repository at this point in the history
  • Loading branch information
abr-egn committed Mar 18, 2022
1 parent 9549dea commit 908e469
Show file tree
Hide file tree
Showing 2 changed files with 416 additions and 0 deletions.
279 changes: 279 additions & 0 deletions src/test/spec/json/retryable-writes/unified/handshakeError.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
{
"description": "retryable writes handshake failures",
"schemaVersion": "1.3",
"runOnRequirements": [
{
"minServerVersion": "4.2",
"topologies": [
"replicaset",
"sharded",
"load-balanced"
],
"auth": true
}
],
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent",
"connectionCheckOutStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "retryable-handshake-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll"
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "retryable-handshake-tests",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
],
"tests": [
{
"description": "InsertOne succeeds after retryable handshake error",
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"saslContinue",
"ping"
],
"closeConnection": true
}
}
}
},
{
"name": "runCommand",
"object": "database0",
"arguments": {
"commandName": "ping",
"command": {
"ping": 1
}
},
"expectError": {
"isError": true
}
},
{
"name": "insertOne",
"object": "collection0",
"arguments": {
"document": {
"_id": 2,
"x": 22
}
}
}
],
"expectEvents": [
{
"client": "client0",
"eventType": "cmap",
"events": [
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
}
]
},
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"ping": 1
},
"databaseName": "retryable-handshake-tests"
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 2,
"x": 22
}
]
},
"commandName": "insert",
"databaseName": "retryable-handshake-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "coll",
"databaseName": "retryable-handshake-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
},
{
"description": "InsertOne succeeds after retryable handshake error ShutdownInProgress",
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"saslContinue",
"ping"
],
"errorCode": 91
}
}
}
},
{
"name": "runCommand",
"object": "database0",
"arguments": {
"commandName": "ping",
"command": {
"ping": 1
}
},
"expectError": {
"isError": true
}
},
{
"name": "insertOne",
"object": "collection0",
"arguments": {
"document": {
"_id": 2,
"x": 22
}
}
}
],
"expectEvents": [
{
"client": "client0",
"eventType": "cmap",
"events": [
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
},
{
"connectionCheckOutStartedEvent": {}
}
]
},
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"ping": 1
},
"databaseName": "retryable-handshake-tests"
}
},
{
"commandStartedEvent": {
"command": {
"insert": "coll",
"documents": [
{
"_id": 2,
"x": 22
}
]
},
"commandName": "insert",
"databaseName": "retryable-handshake-tests"
}
}
]
}
],
"outcome": [
{
"collectionName": "coll",
"databaseName": "retryable-handshake-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
]
}
]
}
Loading

0 comments on commit 908e469

Please sign in to comment.