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

Add option to disable stub reset after each test method #70

Closed
djjorjinho opened this issue Dec 4, 2024 · 6 comments
Closed

Add option to disable stub reset after each test method #70

djjorjinho opened this issue Dec 4, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@djjorjinho
Copy link

djjorjinho commented Dec 4, 2024

Proposal

Support a wiremock server option to selectively disable stub reset.

spring-cloud-contract already supports this option, maybe this project can support the same?

References

No response

@djjorjinho djjorjinho added the enhancement New feature or request label Dec 4, 2024
@tomasbjerre
Copy link
Collaborator

Should be a simple feature to add.

Just curious about the use case. When is this needed?

@djjorjinho
Copy link
Author

Just curious about the use case. When is this needed?

I want to use this to debug an issue I'm having with concurrent test execution at the class and method level. My tests rely on a correlation id header and don't clash with each other, but I have tests failing with 404 if they run concurrently, even with a @DirtiesContext annotation.

I can raise an issue or a feature for this situation as well, but I would like to understand what is actually happening first, because these tests can run fine on certain machines, but fail randomly on others, so I can't effectively replicate this atm.

So I would like to start debugging with a single mockserver for every service, that runs for the duration of all tests with all necessary stubs; I think it would make the setup deterministic enough for me to wrap my head around what is happening.

@tomasbjerre
Copy link
Collaborator

@djjorjinho can you have quick look at #71 ? Do you think that will help?

@djjorjinho
Copy link
Author

@tomasbjerre yes that would work, thanks 🙂

tomasbjerre added a commit that referenced this issue Dec 8, 2024
…ble-reset

feat: optionally disable reset to enable concurrency (refs #70)
@tomasbjerre
Copy link
Collaborator

Released it now as 3.4.0.

@djjorjinho
Copy link
Author

Many thanks @tomasbjerre 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants