...

Text file src/go.mongodb.org/mongo-driver/testdata/connection-monitoring-and-pooling/pool-checkout-maxConnecting-timeout.yml

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

     1version: 1
     2style: integration
     3description: waiting on maxConnecting is limited by WaitQueueTimeoutMS
     4runOn:
     5  -
     6    # required for blockConnection in fail point
     7    minServerVersion: "4.4.0"
     8failPoint:
     9  configureFailPoint: failCommand
    10  # high amount to ensure not interfered with by monitor checks.
    11  mode: { times: 50 }
    12  data:
    13    failCommands: ["isMaster","hello"]
    14    closeConnection: false
    15    blockConnection: true
    16    blockTimeMS: 750
    17poolOptions:
    18  maxPoolSize: 10
    19  # Drivers that limit connection establishment by waitQueueTimeoutMS may skip
    20  # this test. While waitQueueTimeoutMS is technically not supposed to limit establishment time,
    21  # it will soon be deprecated, so it is easier for those drivers to just skip this test.
    22  waitQueueTimeoutMS: 50
    23operations:
    24  - name: ready
    25  # start creating two connections simultaneously.
    26  - name: start
    27    target: thread1
    28  - name: checkOut
    29    thread: thread1
    30  - name: start
    31    target: thread2
    32  - name: checkOut
    33    thread: thread2
    34  # wait for other two threads to start establishing
    35  - name: waitForEvent
    36    event: ConnectionCreated
    37    count: 2
    38  # start a third thread that will be blocked waiting for
    39  # one of the other two to finish
    40  - name: start
    41    target: thread3
    42  - name: checkOut
    43    thread: thread3
    44  - name: waitForEvent
    45    event: ConnectionCheckOutFailed
    46    count: 1
    47  # rejoin thread3, should experience error
    48  - name: waitForThread
    49    target: thread3
    50error:
    51  type: WaitQueueTimeoutError
    52  message: Timed out while checking out a connection from connection pool
    53events:
    54  - type: ConnectionCheckOutStarted
    55    address: 42
    56  - type: ConnectionCheckOutStarted
    57    address: 42
    58  - type: ConnectionCheckOutStarted
    59    address: 42
    60  - type: ConnectionCheckOutFailed
    61    reason: timeout
    62    address: 42
    63ignore:
    64  - ConnectionCreated
    65  - ConnectionCheckedIn
    66  - ConnectionCheckedOut
    67  - ConnectionClosed
    68  - ConnectionPoolCreated
    69  - ConnectionPoolReady

View as plain text