Skip to content

Commit

Permalink
test(NODE-6527): sync pool-checkout-returned-connection-maxConnecting…
Browse files Browse the repository at this point in the history
… tests (#4344)
  • Loading branch information
baileympearson authored Dec 3, 2024
1 parent 4842cd8 commit 260e052
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
}
},
"poolOptions": {
"maxConnecting": 2,
"maxPoolSize": 10,
"waitQueueTimeoutMS": 5000
},
Expand Down Expand Up @@ -72,9 +73,8 @@
"connection": "conn0"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckedOut",
"count": 4
"name": "wait",
"ms": 100
}
],
"events": [
Expand Down Expand Up @@ -104,14 +104,6 @@
"type": "ConnectionCheckedOut",
"connectionId": 1,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"address": 42
},
{
"type": "ConnectionCheckedOut",
"address": 42
}
],
"ignore": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ failPoint:
blockConnection: true
blockTimeMS: 750
poolOptions:
maxConnecting: 2
maxPoolSize: 10
waitQueueTimeoutMS: 5000
operations:
Expand Down Expand Up @@ -45,14 +46,13 @@ operations:
count: 4
- name: wait
ms: 100
# check original connection back in, so the thread that isn't
# currently establishing will become unblocked. Then wait for
# all threads to complete.
# Check original connection back in, so one of the waiting threads can check
# out the idle connection before the two new connections are ready.
- name: checkIn
connection: conn0
- name: waitForEvent
event: ConnectionCheckedOut
count: 4
# Wait for 100ms to let one of the blocked checkOut operations complete.
- name: wait
ms: 100
events:
# main thread checking out a Connection and holding it
- type: ConnectionCreated
Expand All @@ -69,15 +69,13 @@ events:
- type: ConnectionCheckedIn
connectionId: 1
address: 42
# remaining thread checking out the returned Connection
# Another thread checks out the returned Connection before the two new
# connections are checked out.
- type: ConnectionCheckedOut
connectionId: 1
address: 42
# first two threads finishing Connection establishment
- type: ConnectionCheckedOut
address: 42
- type: ConnectionCheckedOut
address: 42
# Events after this can come in different orders but still be valid.
# See DRIVERS-2223 for details.
ignore:
- ConnectionPoolReady
- ConnectionClosed
Expand Down

0 comments on commit 260e052

Please sign in to comment.