withHealthCheck method

GenericContainer withHealthCheck(
  1. List<String> test, {
  2. Duration interval = const Duration(seconds: 1),
  3. Duration timeout = const Duration(seconds: 3),
  4. int retries = 10,
})

Gives the container a health check, for Wait.forHealthcheck() and for images that define none: test is the command in exec form (['CMD-SHELL', 'pg_isready -U test']), run every interval; after retries failures the container is unhealthy.

Implementation

GenericContainer withHealthCheck(
  List<String> test, {
  Duration interval = const Duration(seconds: 1),
  Duration timeout = const Duration(seconds: 3),
  int retries = 10,
}) {
  _healthCheck = (
    test: List.of(test),
    interval: interval,
    timeout: timeout,
    retries: retries,
  );
  return this;
}