-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
DirtiesContext used with Webflux, a random port and multiple contexts causes multiple contexts to misbehave #38199
Comments
I've tracked this down to this call being made to It seems that @bclozel @rstoyanchev Is this a Framework bug or something we need to configure in Spring Boot. Should we be setting |
Hello. I've the same problem using spring boot 3.2.4, and spring framework libraries version 6.1.5. For my test, execution steps same with topic. I had receiving this problem after migration to spring boot 3, in branch with spring boot 2 problem isn't reproduced |
@philwebb I think setting |
We're going to investigate using a post processor in the tests to change the flag. |
Bug description
I'm having an issue while running tests using Webflux. Tests are set up to run on a random port and access a controller using HttpClient (I've tested and the same issue happens with WebTestClient). If there are multiple application contexts used for the tests, then @DirtiesContext annotation causes contexts not being cleared to misbehave (to stop allowing connections).
Bug reproduce
Here is the simplest dummy app I've managed to build which replicates the issue: https://github.com/Dodomix/multiple-test-contexts-bug. If you run Test1 -> Test2 -> Test3, Test3 will fail. Each test by itself passes.
Expected behavior
All tests pass.
System info
Java: Temurin 17.0.9
The text was updated successfully, but these errors were encountered: