333 lines
7.7 KiB
JSON
333 lines
7.7 KiB
JSON
{
|
|
"description": "timeoutMS can be overridden at the level of a ClientSession",
|
|
"schemaVersion": "1.9",
|
|
"runOnRequirements": [
|
|
{
|
|
"minServerVersion": "4.4",
|
|
"topologies": [
|
|
"replicaset",
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"createEntities": [
|
|
{
|
|
"client": {
|
|
"id": "failPointClient",
|
|
"useMultipleMongoses": false
|
|
}
|
|
},
|
|
{
|
|
"client": {
|
|
"id": "client",
|
|
"useMultipleMongoses": false,
|
|
"observeEvents": [
|
|
"commandStartedEvent",
|
|
"commandSucceededEvent",
|
|
"commandFailedEvent"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"database": {
|
|
"id": "database",
|
|
"client": "client",
|
|
"databaseName": "test"
|
|
}
|
|
},
|
|
{
|
|
"collection": {
|
|
"id": "collection",
|
|
"database": "database",
|
|
"collectionName": "coll"
|
|
}
|
|
},
|
|
{
|
|
"session": {
|
|
"id": "session",
|
|
"client": "client",
|
|
"sessionOptions": {
|
|
"defaultTimeoutMS": 500
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"initialData": [
|
|
{
|
|
"collectionName": "coll",
|
|
"databaseName": "test",
|
|
"documents": []
|
|
}
|
|
],
|
|
"tests": [
|
|
{
|
|
"description": "timeoutMS applied to commitTransaction",
|
|
"operations": [
|
|
{
|
|
"name": "failPoint",
|
|
"object": "testRunner",
|
|
"arguments": {
|
|
"client": "failPointClient",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 1
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"commitTransaction"
|
|
],
|
|
"blockConnection": true,
|
|
"blockTimeMS": 600
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "startTransaction",
|
|
"object": "session"
|
|
},
|
|
{
|
|
"name": "insertOne",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"session": "session",
|
|
"document": {
|
|
"_id": 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "commitTransaction",
|
|
"object": "session",
|
|
"expectError": {
|
|
"isTimeoutError": true
|
|
}
|
|
}
|
|
],
|
|
"expectEvents": [
|
|
{
|
|
"client": "client",
|
|
"events": [
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "insert",
|
|
"databaseName": "test",
|
|
"command": {
|
|
"insert": "coll"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandSucceededEvent": {
|
|
"commandName": "insert"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "commitTransaction",
|
|
"databaseName": "admin",
|
|
"command": {
|
|
"commitTransaction": 1,
|
|
"maxTimeMS": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandFailedEvent": {
|
|
"commandName": "commitTransaction"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "timeoutMS applied to abortTransaction",
|
|
"operations": [
|
|
{
|
|
"name": "failPoint",
|
|
"object": "testRunner",
|
|
"arguments": {
|
|
"client": "failPointClient",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 1
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"abortTransaction"
|
|
],
|
|
"blockConnection": true,
|
|
"blockTimeMS": 600
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "startTransaction",
|
|
"object": "session"
|
|
},
|
|
{
|
|
"name": "insertOne",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"session": "session",
|
|
"document": {
|
|
"_id": 1
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "abortTransaction",
|
|
"object": "session"
|
|
}
|
|
],
|
|
"expectEvents": [
|
|
{
|
|
"client": "client",
|
|
"events": [
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "insert",
|
|
"databaseName": "test",
|
|
"command": {
|
|
"insert": "coll"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandSucceededEvent": {
|
|
"commandName": "insert"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "abortTransaction",
|
|
"databaseName": "admin",
|
|
"command": {
|
|
"abortTransaction": 1,
|
|
"maxTimeMS": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandFailedEvent": {
|
|
"commandName": "abortTransaction"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "timeoutMS applied to withTransaction",
|
|
"operations": [
|
|
{
|
|
"name": "failPoint",
|
|
"object": "testRunner",
|
|
"arguments": {
|
|
"client": "failPointClient",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 2
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"insert",
|
|
"abortTransaction"
|
|
],
|
|
"blockConnection": true,
|
|
"blockTimeMS": 600
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "withTransaction",
|
|
"object": "session",
|
|
"arguments": {
|
|
"callback": [
|
|
{
|
|
"name": "insertOne",
|
|
"object": "collection",
|
|
"arguments": {
|
|
"session": "session",
|
|
"document": {
|
|
"_id": 1
|
|
}
|
|
},
|
|
"expectError": {
|
|
"isTimeoutError": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"expectError": {
|
|
"isTimeoutError": true
|
|
}
|
|
}
|
|
],
|
|
"expectEvents": [
|
|
{
|
|
"client": "client",
|
|
"events": [
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "insert",
|
|
"databaseName": "test",
|
|
"command": {
|
|
"insert": "coll",
|
|
"maxTimeMS": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandFailedEvent": {
|
|
"commandName": "insert"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"commandName": "abortTransaction",
|
|
"databaseName": "admin",
|
|
"command": {
|
|
"abortTransaction": 1,
|
|
"maxTimeMS": {
|
|
"$$type": [
|
|
"int",
|
|
"long"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"commandFailedEvent": {
|
|
"commandName": "abortTransaction"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|