Skip to content

Commit 691cbbb

Browse files
authored
test(NODE-5722): unpin on endSessions test (#4326)
1 parent 20564f7 commit 691cbbb

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

test/spec/load-balancers/transactions.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "transactions are correctly pinned to connections for load-balanced clusters",
3-
"schemaVersion": "1.3",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
66
"topologies": [
@@ -1616,6 +1616,50 @@
16161616
]
16171617
}
16181618
]
1619+
},
1620+
{
1621+
"description": "pinned connection is released when session ended",
1622+
"operations": [
1623+
{
1624+
"name": "startTransaction",
1625+
"object": "session0"
1626+
},
1627+
{
1628+
"name": "insertOne",
1629+
"object": "collection0",
1630+
"arguments": {
1631+
"document": {
1632+
"x": 1
1633+
},
1634+
"session": "session0"
1635+
}
1636+
},
1637+
{
1638+
"name": "commitTransaction",
1639+
"object": "session0"
1640+
},
1641+
{
1642+
"name": "endSession",
1643+
"object": "session0"
1644+
}
1645+
],
1646+
"expectEvents": [
1647+
{
1648+
"client": "client0",
1649+
"eventType": "cmap",
1650+
"events": [
1651+
{
1652+
"connectionReadyEvent": {}
1653+
},
1654+
{
1655+
"connectionCheckedOutEvent": {}
1656+
},
1657+
{
1658+
"connectionCheckedInEvent": {}
1659+
}
1660+
]
1661+
}
1662+
]
16191663
}
16201664
]
16211665
}

test/spec/load-balancers/transactions.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: transactions are correctly pinned to connections for load-balanced clusters
22

3-
schemaVersion: '1.3'
3+
schemaVersion: '1.4'
44

55
runOnRequirements:
66
- topologies: [ load-balanced ]
@@ -596,3 +596,21 @@ tests:
596596
- connectionCheckedOutEvent: {}
597597
# Events for abortTransaction.
598598
- connectionCheckedInEvent: {}
599+
600+
- description: pinned connection is released when session ended
601+
operations:
602+
- *startTransaction
603+
- *transactionalInsert
604+
- *commitTransaction
605+
- &endSession
606+
name: endSession
607+
object: *session0
608+
expectEvents:
609+
- client: *client0
610+
eventType: cmap
611+
events:
612+
# Events for the insert and commitTransaction.
613+
- connectionReadyEvent: {}
614+
- connectionCheckedOutEvent: {}
615+
# Events for endSession.
616+
- connectionCheckedInEvent: {}

0 commit comments

Comments
 (0)