version: 1
style: integration
description: error during minPoolSize population clears pool
runOn:
  - # required for appName in fail point
    minServerVersion: "4.9.0"
  # Remove the topology runOn requirement when cmap specs are adjusted for lbs
  - topology: ["single", "replicaset", "sharded"]
failPoint:
  configureFailPoint: failCommand
  # high amount to ensure not interfered with by monitor checks.
  mode: { times: 50 }
  data:
    failCommands: ["isMaster", "hello"]
    errorCode: 91
    appName: "poolCreateMinSizeErrorTest"
poolOptions:
  minPoolSize: 1
  backgroundThreadIntervalMS: 50
  appName: "poolCreateMinSizeErrorTest"
operations:
  - name: ready
  - name: waitForEvent
    event: ConnectionPoolCleared
    count: 1
  # ensure pool doesn't start making new connections
  - name: wait
    ms: 200
events:
  - type: ConnectionPoolReady
    address: 42
  - type: ConnectionCreated
    address: 42
  # The ruby driver clears the pool before closing the connection.
  - type: ConnectionPoolCleared
    address: 42
  - type: ConnectionClosed
    address: 42
    connectionId: 42
    reason: error
ignore:
  - ConnectionPoolCreated
