File tree Expand file tree Collapse file tree 2 files changed +25
-25
lines changed
src/test/spec/json/connection-monitoring-and-pooling Expand file tree Collapse file tree 2 files changed +25
-25
lines changed Original file line number Diff line number Diff line change 30
30
"name" : " start" ,
31
31
"target" : " thread1"
32
32
},
33
- {
34
- "name" : " checkOut" ,
35
- "thread" : " thread1"
36
- },
37
33
{
38
34
"name" : " start" ,
39
35
"target" : " thread2"
40
36
},
41
37
{
42
- "name" : " wait" ,
43
- "thread" : " thread2" ,
44
- "ms" : 100
38
+ "name" : " start" ,
39
+ "target" : " thread3"
45
40
},
46
41
{
47
42
"name" : " checkOut" ,
48
- "thread" : " thread2 "
43
+ "thread" : " thread1 "
49
44
},
50
45
{
51
- "name" : " start" ,
52
- "target" : " thread3"
46
+ "name" : " waitForEvent" ,
47
+ "event" : " ConnectionCreated" ,
48
+ "count" : 1
53
49
},
54
50
{
55
51
"name" : " wait" ,
56
- "thread" : " thread3" ,
57
52
"ms" : 100
58
53
},
54
+ {
55
+ "name" : " checkOut" ,
56
+ "thread" : " thread2"
57
+ },
59
58
{
60
59
"name" : " checkOut" ,
61
60
"thread" : " thread3"
Original file line number Diff line number Diff line change @@ -18,29 +18,30 @@ poolOptions:
18
18
maxPoolSize : 10
19
19
waitQueueTimeoutMS : 5000
20
20
operations :
21
- # start creating a Connection. This will take a while
22
- # due to the fail point.
21
+ # start 3 threads
23
22
- name : start
24
23
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.
25
30
- name : checkOut
26
31
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
29
40
# start creating a Connection and the other one should be
30
41
# waiting for pendingConnectionCount to be less than maxConnecting,
31
42
# only starting once thread1 finishes creating its Connection.
32
- - name : start
33
- target : thread2
34
- - name : wait
35
- thread : thread2
36
- ms : 100
37
43
- name : checkOut
38
44
thread : thread2
39
- - name : start
40
- target : thread3
41
- - name : wait
42
- thread : thread3
43
- ms : 100
44
45
- name : checkOut
45
46
thread : thread3
46
47
# wait until all Connections have been created.
You can’t perform that action at this time.
0 commit comments