Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion test/spec/load-balancers/transactions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "transactions are correctly pinned to connections for load-balanced clusters",
"schemaVersion": "1.3",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"topologies": [
Expand Down Expand Up @@ -1616,6 +1616,50 @@
]
}
]
},
{
"description": "pinned connection is released when session ended",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection0",
"arguments": {
"document": {
"x": 1
},
"session": "session0"
}
},
{
"name": "commitTransaction",
"object": "session0"
},
{
"name": "endSession",
"object": "session0"
}
],
"expectEvents": [
{
"client": "client0",
"eventType": "cmap",
"events": [
{
"connectionReadyEvent": {}
},
{
"connectionCheckedOutEvent": {}
},
{
"connectionCheckedInEvent": {}
}
]
}
]
}
]
}
20 changes: 19 additions & 1 deletion test/spec/load-balancers/transactions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: transactions are correctly pinned to connections for load-balanced clusters

schemaVersion: '1.3'
schemaVersion: '1.4'

runOnRequirements:
- topologies: [ load-balanced ]
Expand Down Expand Up @@ -596,3 +596,21 @@ tests:
- connectionCheckedOutEvent: {}
# Events for abortTransaction.
- connectionCheckedInEvent: {}

- description: pinned connection is released when session ended
operations:
- *startTransaction
- *transactionalInsert
- *commitTransaction
- &endSession
name: endSession
object: *session0
expectEvents:
- client: *client0
eventType: cmap
events:
# Events for the insert and commitTransaction.
- connectionReadyEvent: {}
- connectionCheckedOutEvent: {}
# Events for endSession.
- connectionCheckedInEvent: {}