Skip to content

Commit

Permalink
docs: update Multi Wait Strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
hhsnopek committed Nov 10, 2022
1 parent a7e2de6 commit f47f2a1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docs/features/wait/multi.md
@@ -1,8 +1,11 @@
# Multi Wait strategy

The Multi wait strategy will hold a list of wait strategies, in order to wait for all of them. It's possible to set the following conditions:
The Multi wait strategy holds a list of wait strategies. The execution of each strategy is first added, first executed.

- the startup timeout to be used in seconds, default is 60 seconds.
Available Options:

- `WithDeadline` - the deadline for when all strategies must complete by, default is none.
- `WithStartupTimeoutDefault` - the startup timeout default to be used for each Strategy if not defined in seconds, default is 60 seconds.

```golang
req := ContainerRequest{
Expand All @@ -12,9 +15,11 @@ req := ContainerRequest{
"MYSQL_ROOT_PASSWORD": "password",
"MYSQL_DATABASE": "database",
},
WaitingFor: wait.ForAll(
wait.ForLog("port: 3306 MySQL Community Server - GPL"),
wait.ForListeningPort("3306/tcp"),
).WithStartupTimeout(10*time.Second),
wait.ForAll(
wait.ForLog("port: 3306 MySQL Community Server - GPL"), // Timeout: 120s (from ForAll.WithStartupTimeoutDefault)
wait.ForExposedPort().WithStartupTimeout(180*time.Second), // Timeout: 180s
wait.ForListeningPort("3306/tcp").WithStartupTimeout(10*time.Second), // Timeout: 10s
).WithStartupTimeout(120*time.Second). // Applies default StartupTimeout when not explictly defined
WithDeadline(360*time.Second) // Applies deadline for all Wait Strategies
}
```

0 comments on commit f47f2a1

Please sign in to comment.