Skip to content

[Feature]: ShellStrategy, a new WaitStrategy #6666

@m4rii0

Description

@m4rii0

Module

Core

Problem

There are cases where you can determine if a container has started correctly by checking if a file exists in a certain path (i.e. a lockfile), if a process is active or simply by running a command on the container and expecting a certain value.

Solution

A new strategy class called ShellStrategy that executes a command and checks whether the exit code is either 0 or 1.

new ShellStrategy("stat /var/run/my.lock")

// And using the Wait class
Wait.forSuccessfulCommand("stat /var/run/my.lock")

Benefit

Adding this new strategy users will take advantage of running a command inside the container to check whether the container is fully started or not.

Alternatives

n/a

Would you like to help contributing this feature?

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions