Skip to content

Commit 1fda150

Browse files
Sync up transaction specs
1 parent fa7908e commit 1fda150

File tree

5 files changed

+301
-949
lines changed

5 files changed

+301
-949
lines changed

driver-core/src/test/resources/unified-test-format/transactions/mongos-pin-auto.json

+294
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,104 @@
20042004
}
20052005
]
20062006
},
2007+
{
2008+
"description": "remain pinned after non-transient Interrupted error on clientBulkWrite bulkWrite",
2009+
"operations": [
2010+
{
2011+
"object": "session0",
2012+
"name": "startTransaction"
2013+
},
2014+
{
2015+
"object": "collection0",
2016+
"name": "insertOne",
2017+
"arguments": {
2018+
"session": "session0",
2019+
"document": {
2020+
"_id": 3
2021+
}
2022+
},
2023+
"expectResult": {
2024+
"$$unsetOrMatches": {
2025+
"insertedId": {
2026+
"$$unsetOrMatches": 3
2027+
}
2028+
}
2029+
}
2030+
},
2031+
{
2032+
"name": "targetedFailPoint",
2033+
"object": "testRunner",
2034+
"arguments": {
2035+
"session": "session0",
2036+
"failPoint": {
2037+
"configureFailPoint": "failCommand",
2038+
"mode": {
2039+
"times": 1
2040+
},
2041+
"data": {
2042+
"failCommands": [
2043+
"bulkWrite"
2044+
],
2045+
"errorCode": 11601
2046+
}
2047+
}
2048+
}
2049+
},
2050+
{
2051+
"name": "clientBulkWrite",
2052+
"object": "client0",
2053+
"arguments": {
2054+
"session": "session0",
2055+
"models": [
2056+
{
2057+
"insertOne": {
2058+
"namespace": "database0.collection0",
2059+
"document": {
2060+
"_id": 8,
2061+
"x": 88
2062+
}
2063+
}
2064+
}
2065+
]
2066+
},
2067+
"expectError": {
2068+
"errorLabelsOmit": [
2069+
"TransientTransactionError"
2070+
]
2071+
}
2072+
},
2073+
{
2074+
"object": "testRunner",
2075+
"name": "assertSessionPinned",
2076+
"arguments": {
2077+
"session": "session0"
2078+
}
2079+
},
2080+
{
2081+
"object": "session0",
2082+
"name": "abortTransaction"
2083+
}
2084+
],
2085+
"outcome": [
2086+
{
2087+
"collectionName": "test",
2088+
"databaseName": "transaction-tests",
2089+
"documents": [
2090+
{
2091+
"_id": 1
2092+
},
2093+
{
2094+
"_id": 2
2095+
}
2096+
]
2097+
}
2098+
],
2099+
"runOnRequirements": [
2100+
{
2101+
"minServerVersion": "8.0"
2102+
}
2103+
]
2104+
},
20072105
{
20082106
"description": "unpin after transient connection error on insertOne insert",
20092107
"operations": [
@@ -5175,6 +5273,202 @@
51755273
]
51765274
}
51775275
]
5276+
},
5277+
{
5278+
"description": "unpin after transient connection error on clientBulkWrite bulkWrite",
5279+
"operations": [
5280+
{
5281+
"object": "session0",
5282+
"name": "startTransaction"
5283+
},
5284+
{
5285+
"object": "collection0",
5286+
"name": "insertOne",
5287+
"arguments": {
5288+
"session": "session0",
5289+
"document": {
5290+
"_id": 3
5291+
}
5292+
},
5293+
"expectResult": {
5294+
"$$unsetOrMatches": {
5295+
"insertedId": {
5296+
"$$unsetOrMatches": 3
5297+
}
5298+
}
5299+
}
5300+
},
5301+
{
5302+
"name": "targetedFailPoint",
5303+
"object": "testRunner",
5304+
"arguments": {
5305+
"session": "session0",
5306+
"failPoint": {
5307+
"configureFailPoint": "failCommand",
5308+
"mode": {
5309+
"times": 1
5310+
},
5311+
"data": {
5312+
"failCommands": [
5313+
"bulkWrite"
5314+
],
5315+
"closeConnection": true
5316+
}
5317+
}
5318+
}
5319+
},
5320+
{
5321+
"name": "clientBulkWrite",
5322+
"object": "client0",
5323+
"arguments": {
5324+
"session": "session0",
5325+
"models": [
5326+
{
5327+
"insertOne": {
5328+
"namespace": "database0.collection0",
5329+
"document": {
5330+
"_id": 8,
5331+
"x": 88
5332+
}
5333+
}
5334+
}
5335+
]
5336+
},
5337+
"expectError": {
5338+
"errorLabelsContain": [
5339+
"TransientTransactionError"
5340+
]
5341+
}
5342+
},
5343+
{
5344+
"object": "testRunner",
5345+
"name": "assertSessionUnpinned",
5346+
"arguments": {
5347+
"session": "session0"
5348+
}
5349+
},
5350+
{
5351+
"object": "session0",
5352+
"name": "abortTransaction"
5353+
}
5354+
],
5355+
"outcome": [
5356+
{
5357+
"collectionName": "test",
5358+
"databaseName": "transaction-tests",
5359+
"documents": [
5360+
{
5361+
"_id": 1
5362+
},
5363+
{
5364+
"_id": 2
5365+
}
5366+
]
5367+
}
5368+
],
5369+
"runOnRequirements": [
5370+
{
5371+
"minServerVersion": "8.0"
5372+
}
5373+
]
5374+
},
5375+
{
5376+
"description": "unpin after transient ShutdownInProgress error on clientBulkWrite bulkWrite",
5377+
"operations": [
5378+
{
5379+
"object": "session0",
5380+
"name": "startTransaction"
5381+
},
5382+
{
5383+
"object": "collection0",
5384+
"name": "insertOne",
5385+
"arguments": {
5386+
"session": "session0",
5387+
"document": {
5388+
"_id": 3
5389+
}
5390+
},
5391+
"expectResult": {
5392+
"$$unsetOrMatches": {
5393+
"insertedId": {
5394+
"$$unsetOrMatches": 3
5395+
}
5396+
}
5397+
}
5398+
},
5399+
{
5400+
"name": "targetedFailPoint",
5401+
"object": "testRunner",
5402+
"arguments": {
5403+
"session": "session0",
5404+
"failPoint": {
5405+
"configureFailPoint": "failCommand",
5406+
"mode": {
5407+
"times": 1
5408+
},
5409+
"data": {
5410+
"failCommands": [
5411+
"bulkWrite"
5412+
],
5413+
"errorCode": 91
5414+
}
5415+
}
5416+
}
5417+
},
5418+
{
5419+
"name": "clientBulkWrite",
5420+
"object": "client0",
5421+
"arguments": {
5422+
"session": "session0",
5423+
"models": [
5424+
{
5425+
"insertOne": {
5426+
"namespace": "database0.collection0",
5427+
"document": {
5428+
"_id": 8,
5429+
"x": 88
5430+
}
5431+
}
5432+
}
5433+
]
5434+
},
5435+
"expectError": {
5436+
"errorLabelsContain": [
5437+
"TransientTransactionError"
5438+
]
5439+
}
5440+
},
5441+
{
5442+
"object": "testRunner",
5443+
"name": "assertSessionUnpinned",
5444+
"arguments": {
5445+
"session": "session0"
5446+
}
5447+
},
5448+
{
5449+
"object": "session0",
5450+
"name": "abortTransaction"
5451+
}
5452+
],
5453+
"outcome": [
5454+
{
5455+
"collectionName": "test",
5456+
"databaseName": "transaction-tests",
5457+
"documents": [
5458+
{
5459+
"_id": 1
5460+
},
5461+
{
5462+
"_id": 2
5463+
}
5464+
]
5465+
}
5466+
],
5467+
"runOnRequirements": [
5468+
{
5469+
"minServerVersion": "8.0"
5470+
}
5471+
]
51785472
}
51795473
]
51805474
}

0 commit comments

Comments
 (0)