Skip to content

Commit e72fccb

Browse files
committed
RUST-609 Fix flaky maxConnecting test
1 parent 7848b90 commit e72fccb

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/test/spec/json/connection-monitoring-and-pooling/pool-checkout-maxConnecting-is-enforced.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,31 @@
3030
"name": "start",
3131
"target": "thread1"
3232
},
33-
{
34-
"name": "checkOut",
35-
"thread": "thread1"
36-
},
3733
{
3834
"name": "start",
3935
"target": "thread2"
4036
},
4137
{
42-
"name": "wait",
43-
"thread": "thread2",
44-
"ms": 100
38+
"name": "start",
39+
"target": "thread3"
4540
},
4641
{
4742
"name": "checkOut",
48-
"thread": "thread2"
43+
"thread": "thread1"
4944
},
5045
{
51-
"name": "start",
52-
"target": "thread3"
46+
"name": "waitForEvent",
47+
"event": "ConnectionCreated",
48+
"count": 1
5349
},
5450
{
5551
"name": "wait",
56-
"thread": "thread3",
5752
"ms": 100
5853
},
54+
{
55+
"name": "checkOut",
56+
"thread": "thread2"
57+
},
5958
{
6059
"name": "checkOut",
6160
"thread": "thread3"

src/test/spec/json/connection-monitoring-and-pooling/pool-checkout-maxConnecting-is-enforced.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,30 @@ poolOptions:
1818
maxPoolSize: 10
1919
waitQueueTimeoutMS: 5000
2020
operations:
21-
# start creating a Connection. This will take a while
22-
# due to the fail point.
21+
# start 3 threads
2322
- name: start
2423
target: thread1
24+
- name: start
25+
target: thread2
26+
- name: start
27+
target: thread3
28+
# start creating a Connection. This will take a while
29+
# due to the fail point.
2530
- name: checkOut
2631
thread: thread1
27-
# Start 2 new threads that wait for a little then try
28-
# to check out connections. Only one thread should
32+
# wait for thread1 to actually start creating a Connection
33+
- name: waitForEvent
34+
event: ConnectionCreated
35+
count: 1
36+
# wait some more time to ensure thread1 has begun establishing a Connection
37+
- name: wait
38+
ms: 100
39+
# start 2 check out requests. Only one thread should
2940
# start creating a Connection and the other one should be
3041
# waiting for pendingConnectionCount to be less than maxConnecting,
3142
# only starting once thread1 finishes creating its Connection.
32-
- name: start
33-
target: thread2
34-
- name: wait
35-
thread: thread2
36-
ms: 100
3743
- name: checkOut
3844
thread: thread2
39-
- name: start
40-
target: thread3
41-
- name: wait
42-
thread: thread3
43-
ms: 100
4445
- name: checkOut
4546
thread: thread3
4647
# wait until all Connections have been created.

0 commit comments

Comments
 (0)