From f47f2a14d9051b3ed60076daa83fff1fe65147a2 Mon Sep 17 00:00:00 2001 From: Henry Snopek Date: Wed, 9 Nov 2022 22:35:45 -0600 Subject: [PATCH] docs: update Multi Wait Strategy --- docs/features/wait/multi.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/features/wait/multi.md b/docs/features/wait/multi.md index 0511d0d449..8e3c28d656 100644 --- a/docs/features/wait/multi.md +++ b/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{ @@ -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 } ```