Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to override waiting strategy and waiting time in Tests #35

Conversation

bitxon
Copy link
Contributor

@bitxon bitxon commented May 6, 2023

Motivation

default waiting strategy needs to be configured in constructor.
method configure() is being executed right before container starts, so if we set waiting strategy here we will override any user specified waiters

Before fix

    public WireMockContainer wiremockServer = new WireMockContainer("2.35.0")
            .waitingFor(Wait.defaultWaitStrategy()) // ignored due to bug
            .withStartupTimeout(Duration.ofSeconds(11)) // ignored due to bug

After fix

   public WireMockContainer wiremockServer = new WireMockContainer("2.35.0")
            .waitingFor(Wait.defaultWaitStrategy()) // developer able to override strategy
            .withStartupTimeout(Duration.ofSeconds(11)) // developer able to override timeout

@bitxon bitxon requested a review from oleg-nenashev as a code owner May 6, 2023 15:12
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, thanks for the patch!

@oleg-nenashev oleg-nenashev added the bug Something isn't working label May 8, 2023
@oleg-nenashev oleg-nenashev merged commit b610044 into wiremock:main May 8, 2023
@oleg-nenashev oleg-nenashev changed the title Allow to override waiting strategy and waiting time Allow to override waiting strategy and waiting time in Tests May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants