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

Debug logging for DependencyInjectionTestExecutionListener breaks injection for parallel tests [SPR-10635] #15263

Closed
spring-issuemaster opened this Issue Jun 7, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Jun 7, 2013

Chris Hansen opened SPR-10635 and commented

Setup:

  • JUnit 4.11
  • Surefire 2.14.1 with <parallel>methods</parallel> or <parallel>both</parallel>
  • Spring 3.2.3.RELEASE
  • log4j 1.2.17
    • log4j.properties contains log4j.logger.org.springframework.test.context.support.DependencyInjectionTestExecutionListener=DEBUG

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 log4j.logger.org.springframework.test.context.support.DependencyInjectionTestExecutionListener=DEBUG from log4j.properties, it works. This behavior is VERY consistent for me.

Minimal failing example project: https://github.com/hansenc/parallel-injection-bug


Affects: 3.2.3

Reference URL: https://github.com/hansenc/parallel-injection-bug

Issue Links:

  • #10532 Allow for concurrent test execution in the TestContext framework ("duplicates")
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Jun 9, 2013

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.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Jun 9, 2013

Sam Brannen commented

This issue is essentially a duplicate of #10532.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Jun 10, 2013

Chris Hansen commented

That makes perfect sense. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment