ExecWaitStrategy class
Waits until a command executed inside the container exits with the expected exit code.
The command is run by calling WaitStrategyTarget.exec on each poll cycle.
Example:
container.waitingFor(
ExecWaitStrategy(['pg_isready', '-U', 'postgres']),
);
- Inheritance
-
- Object
- WaitStrategy
- ExecWaitStrategy
Constructors
-
ExecWaitStrategy(List<
String> command, {int expectedExitCode = 0}) -
Creates an ExecWaitStrategy for
command. - ExecWaitStrategy.shell(String command, {int expectedExitCode = 0})
-
Creates an ExecWaitStrategy that runs a single shell command string.
factory
Properties
-
command
→ List<
String> -
The command to run inside the container on each poll attempt.
final
- expectedExitCode → int
-
The exit code that indicates the container is ready.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- pollInterval ↔ Duration
-
Time between successive polling attempts.
getter/setter pairinherited
- 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
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> -
Runs command inside the container on each poll cycle until its exit code
equals expectedExitCode.
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
exceptionsto the set of exception types that are treated as transient failures during polling.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited