bson/testdata/connection-monitoring-and-pooling/pool-clear-clears-waitqueue.yml
2025-03-17 20:58:26 +01:00

64 lines
1.5 KiB
YAML

version: 1
style: unit
description: clearing pool clears the WaitQueue
poolOptions:
maxPoolSize: 1
waitQueueTimeoutMS: 30000
operations:
- name: ready
# check out only connection in the pool
- name: checkOut
# start a few threads that all will enter
# the wait queue
- name: start
target: thread1
- name: checkOut
thread: thread1
- name: start
target: thread2
- name: checkOut
thread: thread2
- name: start
target: thread3
- name: checkOut
thread: thread3
# wait for the 3 threads to start checking out a connection
- name: waitForEvent
event: ConnectionCheckOutStarted
count: 4
# clear the pool, ejecting the previous three threads
# from the WaitQueue
- name: clear
- name: waitForEvent
event: ConnectionCheckOutFailed
count: 3
timeout: 1000
events:
- type: ConnectionCheckOutStarted
address: 42
- type: ConnectionCheckedOut
address: 42
- type: ConnectionCheckOutStarted
address: 42
- type: ConnectionCheckOutStarted
address: 42
- type: ConnectionCheckOutStarted
address: 42
- type: ConnectionCheckOutFailed
reason: connectionError
address: 42
- type: ConnectionCheckOutFailed
reason: connectionError
address: 42
- type: ConnectionCheckOutFailed
reason: connectionError
address: 42
ignore:
- ConnectionPoolReady
- ConnectionPoolCleared
- ConnectionPoolCreated
- ConnectionCreated
- ConnectionReady
- ConnectionCheckedIn
- ConnectionClosed