...

Text file src/go.mongodb.org/mongo-driver/testdata/connection-monitoring-and-pooling/pool-clear-clears-waitqueue.yml

Documentation: go.mongodb.org/mongo-driver/testdata/connection-monitoring-and-pooling

     1version: 1
     2style: unit
     3description: clearing pool clears the WaitQueue
     4poolOptions:
     5  maxPoolSize: 1
     6  waitQueueTimeoutMS: 30000
     7operations:
     8  - name: ready
     9  # check out only connection in the pool
    10  - name: checkOut
    11  # start a few threads that all will enter
    12  # the wait queue
    13  - name: start
    14    target: thread1
    15  - name: checkOut
    16    thread: thread1
    17  - name: start
    18    target: thread2
    19  - name: checkOut
    20    thread: thread2
    21  - name: start
    22    target: thread3 
    23  - name: checkOut
    24    thread: thread3
    25  # wait for the 3 threads to start checking out a connection
    26  - name: waitForEvent
    27    event: ConnectionCheckOutStarted
    28    count: 4
    29  # clear the pool, ejecting the previous three threads
    30  # from the WaitQueue
    31  - name: clear
    32  - name: waitForEvent
    33    event: ConnectionCheckOutFailed
    34    count: 3
    35    timeout: 1000
    36events:
    37  - type: ConnectionCheckOutStarted
    38    address: 42
    39  - type: ConnectionCheckedOut
    40    address: 42
    41  - type: ConnectionCheckOutStarted
    42    address: 42
    43  - type: ConnectionCheckOutStarted
    44    address: 42
    45  - type: ConnectionCheckOutStarted
    46    address: 42
    47  - type: ConnectionCheckOutFailed
    48    reason: connectionError
    49    address: 42
    50  - type: ConnectionCheckOutFailed
    51    reason: connectionError
    52    address: 42
    53  - type: ConnectionCheckOutFailed
    54    reason: connectionError
    55    address: 42
    56ignore:
    57  - ConnectionPoolReady
    58  - ConnectionPoolCleared
    59  - ConnectionPoolCreated
    60  - ConnectionCreated
    61  - ConnectionReady
    62  - ConnectionCheckedIn
    63  - ConnectionClosed

View as plain text