-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Description
Bastian Voigt opened SPR-12421 and commented
Status Quo
When using the maven surefire setting parallel=methods, JUnit still creates only one runner instance per test class, i.e. one runner instance is used by multiple threads in parallel.
SpringJUnit4ClassRunner uses a single TestContextManager which stores the current TestContext in an instance field.
Proposal
SpringJUnit4ClassRunner should use a ThreadLocal instead of a single TestContextManager instance field.
Deliverables
- Improve thread safety for the
SpringRunnerfor JUnit 4. - Improve thread safety for the
SpringClassRuleandSpringMethodRulefor JUnit 4. - Improve thread safety for the
SpringExtensionfor JUnit Jupiter (in JUnit 5).- Partially addressed in JUnit Jupiter in ExtensionContext.Store is not thread-safe junit-team/junit-framework#478
Affects: 3.0 GA
Reference URL: http://stackoverflow.com/questions/26882936/why-does-springjunit4classrunner-not-work-with-surefire-parallel-methods
Issue Links:
- Allow for concurrent test execution in the TestContext framework [SPR-5863] #10532 Allow for concurrent test execution in the TestContext framework ("duplicates")
3 votes, 5 watchers
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement