version: 1
style: unit
description: Pool clear SHOULD schedule the next background thread run immediately (interruptInUseConnections = false)
poolOptions:
  # ensure it's not involved by default
  backgroundThreadIntervalMS: 10000
operations:
  - name: ready
  - name: checkOut
  - name: checkOut
    label: conn
  - name: checkIn
    connection: conn
  - name: clear
    interruptInUseConnections: false
  - name: waitForEvent
    event: ConnectionPoolCleared
    count: 1
    timeout: 1000
  - name: waitForEvent
    event: ConnectionClosed
    count: 1
    timeout: 1000
  - name: close
events:
  - type: ConnectionCheckedOut
    connectionId: 1
    address: 42
  - type: ConnectionCheckedOut
    connectionId: 2
    address: 42
  - type: ConnectionCheckedIn
    connectionId: 2
    address: 42
  - type: ConnectionPoolCleared
    interruptInUseConnections: false
  - type: ConnectionClosed
    connectionId: 2
    reason: stale
    address: 42
  - type: ConnectionPoolClosed
    address: 42
ignore:
  - ConnectionCreated
  - ConnectionPoolReady
  - ConnectionReady
  - ConnectionCheckOutStarted
  - ConnectionPoolCreated