LogMessageWaitStrategy class

Waits until a specific log message appears in the container's output.

Polls WaitStrategyTarget.logs repeatedly. Each iteration also calls WaitStrategyTarget.reload so that the container status is up-to-date.

Example:

container.waitingFor(
  LogMessageWaitStrategy(RegExp(r'Started\.'))
    ..withStartupTimeout(const Duration(seconds: 60)),
);
Inheritance

Constructors

LogMessageWaitStrategy(Pattern message, {int times = 1, bool predicateStreamsAnd = false})
Creates a LogMessageWaitStrategy that waits for message to appear at least times times in the container logs.

Properties

hashCode → int
The hash code for this object.
no setterinherited
message → Pattern
The pattern to search for in the container's log output.
final
pollInterval ↔ Duration
Time between successive polling attempts.
getter/setter pairinherited
predicateStreamsAnd → bool
Whether message must appear in both stdout and stderr.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startupTimeout ↔ Duration
Maximum time to wait for the container to become ready.
getter/setter pairinherited
times → int
The minimum number of times message must appear before the container is considered ready.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
poll(Future<bool> check(), {List<Type>? transientExceptions}) → Future<bool>
Adaptive polling loop.
inherited
toString() → String
A string representation of this object.
inherited
waitUntilReady(WaitStrategyTarget target) → Future<void>
Polls the container's log output until message appears times times.
override
withPollInterval(Duration interval) → WaitStrategy
Sets the poll interval between readiness checks.
inherited
withStartupTimeout(Duration timeout) → WaitStrategy
Sets the maximum startup timeout.
inherited
withTransientExceptions(List<Type> exceptions) → WaitStrategy
Adds exceptions to the set of exception types that are treated as transient failures during polling.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited