Skip to content

Commit

Permalink
test(NODE-5722): unpin on endSessions test (#4326)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran authored Nov 14, 2024
1 parent 20564f7 commit 691cbbb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
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: {}

0 comments on commit 691cbbb

Please sign in to comment.