Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Debug logging for DependencyInjectionTestExecutionListener breaks injection for parallel tests [SPR-10635] #15263
With the above setup, dependency injection works on one method, yet fails on another (same test class, separate test class instances). If you comment out
Minimal failing example project: https://github.com/hansenc/parallel-injection-bug
Reference URL: https://github.com/hansenc/parallel-injection-bug
Sam Brannen commented
Thanks for creating the project on GitHub. That made it easy to try out your scenario!
However, having experimented with your example, it turns out that logging is not the cause of the problem. Instead, concurrent execution of tests in the TestContext framework is a more general problem which will be addressed in #10532.
FYI: turning on debug logging simply increases the chance that the test in your example fails, but if you run the test multiple times without debug logging enabled then the test will still fail sporadically depending on the current CPU load on your machine.