Skip to content

Commit a1c04e2

Browse files
authored
test(NODE-7463): sync spec tests for transactions (#4884)
1 parent db7c730 commit a1c04e2

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

test/spec/transactions/unified/backpressure-retryable-writes.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,17 +412,31 @@
412412
"events": [
413413
{
414414
"commandStartedEvent": {
415-
"commandName": "insert"
415+
"command": {
416+
"startTransaction": true
417+
},
418+
"commandName": "insert",
419+
"databaseName": "transaction-tests"
416420
}
417421
},
418422
{
419423
"commandStartedEvent": {
420-
"commandName": "insert"
424+
"command": {
425+
"startTransaction": true
426+
},
427+
"commandName": "insert",
428+
"databaseName": "transaction-tests"
421429
}
422430
},
423431
{
424432
"commandStartedEvent": {
425-
"commandName": "abortTransaction"
433+
"command": {
434+
"startTransaction": {
435+
"$$exists": false
436+
}
437+
},
438+
"commandName": "abortTransaction",
439+
"databaseName": "admin"
426440
}
427441
}
428442
]
@@ -437,4 +451,4 @@
437451
]
438452
}
439453
]
440-
}
454+
}

test/spec/transactions/unified/backpressure-retryable-writes.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ tests:
144144
outcome:
145145
- collectionName: *collection_name
146146
databaseName: *database_name
147-
documents:
147+
documents:
148148
- { _id: 1 }
149149
- { _id: 2 }
150150
- description: writes are retried maxAttempts=5 times if backpressure labels are added
@@ -239,12 +239,22 @@ tests:
239239
- client: *client0
240240
events:
241241
- commandStartedEvent:
242+
command:
243+
startTransaction: true
242244
commandName: insert
245+
databaseName: *database_name
243246
- commandStartedEvent:
247+
command:
248+
startTransaction: true
244249
commandName: insert
250+
databaseName: *database_name
245251
- commandStartedEvent:
252+
command:
253+
startTransaction:
254+
$$exists: false
246255
commandName: abortTransaction
256+
databaseName: admin
247257
outcome:
248258
- collectionName: *collection_name
249259
databaseName: *database_name
250-
documents: []
260+
documents: []

0 commit comments

Comments
 (0)