Skip to content

Commit 260e052

Browse files
test(NODE-6527): sync pool-checkout-returned-connection-maxConnecting tests (#4344)
1 parent 4842cd8 commit 260e052

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

test/spec/connection-monitoring-and-pooling/cmap-format/pool-checkout-returned-connection-maxConnecting.json

+3-11
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
}
2424
},
2525
"poolOptions": {
26+
"maxConnecting": 2,
2627
"maxPoolSize": 10,
2728
"waitQueueTimeoutMS": 5000
2829
},
@@ -72,9 +73,8 @@
7273
"connection": "conn0"
7374
},
7475
{
75-
"name": "waitForEvent",
76-
"event": "ConnectionCheckedOut",
77-
"count": 4
76+
"name": "wait",
77+
"ms": 100
7878
}
7979
],
8080
"events": [
@@ -104,14 +104,6 @@
104104
"type": "ConnectionCheckedOut",
105105
"connectionId": 1,
106106
"address": 42
107-
},
108-
{
109-
"type": "ConnectionCheckedOut",
110-
"address": 42
111-
},
112-
{
113-
"type": "ConnectionCheckedOut",
114-
"address": 42
115107
}
116108
],
117109
"ignore": [

test/spec/connection-monitoring-and-pooling/cmap-format/pool-checkout-returned-connection-maxConnecting.yml

+10-12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ failPoint:
1515
blockConnection: true
1616
blockTimeMS: 750
1717
poolOptions:
18+
maxConnecting: 2
1819
maxPoolSize: 10
1920
waitQueueTimeoutMS: 5000
2021
operations:
@@ -45,14 +46,13 @@ operations:
4546
count: 4
4647
- name: wait
4748
ms: 100
48-
# check original connection back in, so the thread that isn't
49-
# currently establishing will become unblocked. Then wait for
50-
# all threads to complete.
49+
# Check original connection back in, so one of the waiting threads can check
50+
# out the idle connection before the two new connections are ready.
5151
- name: checkIn
5252
connection: conn0
53-
- name: waitForEvent
54-
event: ConnectionCheckedOut
55-
count: 4
53+
# Wait for 100ms to let one of the blocked checkOut operations complete.
54+
- name: wait
55+
ms: 100
5656
events:
5757
# main thread checking out a Connection and holding it
5858
- type: ConnectionCreated
@@ -69,15 +69,13 @@ events:
6969
- type: ConnectionCheckedIn
7070
connectionId: 1
7171
address: 42
72-
# remaining thread checking out the returned Connection
72+
# Another thread checks out the returned Connection before the two new
73+
# connections are checked out.
7374
- type: ConnectionCheckedOut
7475
connectionId: 1
7576
address: 42
76-
# first two threads finishing Connection establishment
77-
- type: ConnectionCheckedOut
78-
address: 42
79-
- type: ConnectionCheckedOut
80-
address: 42
77+
# Events after this can come in different orders but still be valid.
78+
# See DRIVERS-2223 for details.
8179
ignore:
8280
- ConnectionPoolReady
8381
- ConnectionClosed

0 commit comments

Comments
 (0)