Skip to content

Commit

Permalink
chore(wait): improve walk docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenh committed Nov 26, 2024
1 parent 4c31748 commit a915f07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/features/wait/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ If the default 60s timeout is not sufficient, it can be updated with the `WithSt
Besides that, it's possible to define a poll interval, which will actually stop 100 milliseconds the test execution.

If the default 100 milliseconds poll interval is not sufficient, it can be updated with the `WithPollInterval(pollInterval time.Duration)` function.

## Modifying request strategies

It's possible for options to modify `ContainerRequest.WaitingFor` using
[Walk](sql.md).
9 changes: 8 additions & 1 deletion docs/features/wait/walk.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

Walk walks the strategies tree and calls the visit function for each node.

This allows modules to easily amend default wait strategies, updating or
removing specific strategies based on requirements of functional options.

For example removing a TLS strategy if a functional option enabled insecure mode
or changing the location of the certificate based on the configured user.

If visit function returns `wait.VisitStop`, the walk stops.
If visit function returns `wait.VisitRemove`, the current node is removed.

## Walk removing entries

The following example shows how to remove a strategy based on its type.
<!--codeinclude-->
[Walk a strategy and remove the all FileStrategy entries found](../../../wait/walk_test.go) inside_block:walkRemoveFileStrategy
[Remove FileStrategy entries](../../../wait/walk_test.go) inside_block:walkRemoveFileStrategy
<!--/codeinclude-->
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ nav:
- Log: features/wait/log.md
- Multi: features/wait/multi.md
- SQL: features/wait/sql.md
- Walk: features/wait/walk.md
- Modules:
- modules/index.md
- modules/artemis.md
Expand Down

0 comments on commit a915f07

Please sign in to comment.