Skip to content

Commit ba8a3f7

Browse files
authored
DRIVERS-1539 Cleanup open server transactions in unified unpinning tests (#1027)
1 parent de20b29 commit ba8a3f7

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

source/transactions/tests/unified/mongos-unpin.json

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,24 @@
108108
"arguments": {
109109
"session": "session0"
110110
}
111+
},
112+
{
113+
"name": "startTransaction",
114+
"object": "session0"
115+
},
116+
{
117+
"name": "insertOne",
118+
"object": "collection0",
119+
"arguments": {
120+
"document": {
121+
"x": 1
122+
},
123+
"session": "session0"
124+
}
125+
},
126+
{
127+
"name": "abortTransaction",
128+
"object": "session0"
111129
}
112130
]
113131
},
@@ -142,7 +160,7 @@
142160
]
143161
},
144162
{
145-
"description": "unpin after TransientTransactionError error on abort",
163+
"description": "unpin after non-transient error on abort",
146164
"runOnRequirements": [
147165
{
148166
"serverless": "forbid"
@@ -192,11 +210,29 @@
192210
"arguments": {
193211
"session": "session0"
194212
}
213+
},
214+
{
215+
"name": "startTransaction",
216+
"object": "session0"
217+
},
218+
{
219+
"name": "insertOne",
220+
"object": "collection0",
221+
"arguments": {
222+
"document": {
223+
"x": 1
224+
},
225+
"session": "session0"
226+
}
227+
},
228+
{
229+
"name": "abortTransaction",
230+
"object": "session0"
195231
}
196232
]
197233
},
198234
{
199-
"description": "unpin after non-transient error on abort",
235+
"description": "unpin after TransientTransactionError error on abort",
200236
"operations": [
201237
{
202238
"name": "startTransaction",
@@ -241,6 +277,24 @@
241277
"arguments": {
242278
"session": "session0"
243279
}
280+
},
281+
{
282+
"name": "startTransaction",
283+
"object": "session0"
284+
},
285+
{
286+
"name": "insertOne",
287+
"object": "collection0",
288+
"arguments": {
289+
"document": {
290+
"x": 1
291+
},
292+
"session": "session0"
293+
}
294+
},
295+
{
296+
"name": "abortTransaction",
297+
"object": "session0"
244298
}
245299
]
246300
},

source/transactions/tests/unified/mongos-unpin.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,22 @@ tests:
7070
object: testRunner
7171
arguments:
7272
session: *session0
73-
74-
- description: unpin on successful abort
75-
operations:
73+
# Cleanup the potentionally open server transaction by starting and
74+
# aborting a new transaction on the same session.
7675
- *startTransaction
7776
- *insertOne
7877
- &abortTransaction
7978
name: abortTransaction
8079
object: *session0
80+
81+
- description: unpin on successful abort
82+
operations:
83+
- *startTransaction
84+
- *insertOne
85+
- *abortTransaction
8186
- *assertNoPinnedServer
8287

83-
- description: unpin after TransientTransactionError error on abort
88+
- description: unpin after non-transient error on abort
8489
runOnRequirements:
8590
# serverless proxy doesn't append error labels to errors in transactions
8691
# caused by failpoints (CLOUDP-88216)
@@ -100,8 +105,13 @@ tests:
100105
errorCode: *lockTimeoutErrorCode
101106
- *abortTransaction
102107
- *assertNoPinnedServer
108+
# Cleanup the potentionally open server transaction by starting and
109+
# aborting a new transaction on the same session.
110+
- *startTransaction
111+
- *insertOne
112+
- *abortTransaction
103113

104-
- description: unpin after non-transient error on abort
114+
- description: unpin after TransientTransactionError error on abort
105115
operations:
106116
- *startTransaction
107117
- *insertOne
@@ -117,6 +127,11 @@ tests:
117127
errorCode: 91 # ShutdownInProgress
118128
- *abortTransaction
119129
- *assertNoPinnedServer
130+
# Cleanup the potentionally open server transaction by starting and
131+
# aborting a new transaction on the same session.
132+
- *startTransaction
133+
- *insertOne
134+
- *abortTransaction
120135

121136
- description: unpin when a new transaction is started
122137
operations:

0 commit comments

Comments
 (0)