You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/features/common_functional_options.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,12 +242,14 @@ You can also use `testcontainers.WithAdditionalLifecycleHooks`, which appends th
242
242
243
243
#### Wait Strategies
244
244
245
-
If you need to set a different wait strategy for the container, you can use `testcontainers.WithWaitStrategy` with a valid wait strategy.
245
+
If you need to set a different wait strategy for the container, replacing the existing one, you can use `testcontainers.WithWaitStrategy` with a valid wait strategy.
246
246
247
247
!!!info
248
248
The default deadline for the wait strategy is 60 seconds.
249
249
250
-
At the same time, it's possible to set a wait strategy and a custom deadline with `testcontainers.WithWaitStrategyAndDeadline`.
250
+
At the same time, it's possible to replace the wait strategy with a new one and a custom deadline, using `testcontainers.WithWaitStrategyAndDeadline`.
251
+
252
+
Finally, you can also append a wait strategy to the existing wait strategy, using `testcontainers.WithAdditionalWaitStrategy` and `testcontainers.WithAdditionalWaitStrategyAndDeadline`.
Copy file name to clipboardExpand all lines: docs/modules/index.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -210,8 +210,10 @@ In order to simplify the creation of the container for a given module, `Testcont
210
210
-`testcontainers.WithAdditionalLifecycleHooks`: a function that appends lifecycle hooks to the existing ones for the container request.
211
211
-`testcontainers.WithAlwaysPull`: a function that pulls the image before starting the container.
212
212
-`testcontainers.WithImagePlatform`: a function that sets the image platform for the container request.
213
-
-`testcontainers.WithWaitStrategy`: a function that sets the wait strategy for the container request.
214
-
-`testcontainers.WithWaitStrategyAndDeadline`: a function that sets the wait strategy for the container request with a deadline.
213
+
-`testcontainers.WithWaitStrategy`: a function that replaces the wait strategy for the container request.
214
+
-`testcontainers.WithAdditionalWaitStrategy`: a function that appends the wait strategy for the container request.
215
+
-`testcontainers.WithWaitStrategyAndDeadline`: a function that replaces the wait strategy for the container request with a deadline.
216
+
-`testcontainers.WithAdditionalWaitStrategyAndDeadline`: a function that appends the wait strategy for the container request with a deadline.
215
217
-`testcontainers.WithStartupCommand`: a function that sets the execution of a command when the container starts.
216
218
-`testcontainers.WithAfterReadyCommand`: a function that sets the execution of a command right after the container is ready (its wait strategy is satisfied).
217
219
-`testcontainers.WithDockerfile`: a function that sets the build from a Dockerfile for the container request.
testcontainers.WithWaitStrategy(wait.ForLog("database system is ready to accept connections").WithOccurrence(2).WithStartupTimeout(5*time.Second)),
228
+
testcontainers.WithAdditionalWaitStrategy(wait.ForLog("database system is ready to accept connections").WithOccurrence(2).WithStartupTimeout(5*time.Second)),
testcontainers.WithWaitStrategy(wait.ForLog("database system is ready to accept connections").WithOccurrence(2).WithStartupTimeout(5*time.Second)),
258
+
testcontainers.WithAdditionalWaitStrategy(wait.ForLog("database system is ready to accept connections").WithOccurrence(2).WithStartupTimeout(5*time.Second)),
0 commit comments