spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Do not synchronize `ApplicationContext` creation in the TestContext framework [SPR-10536]

Open spring-projects-issues opened this issue 12 years ago • 1 comments
trafficstars

James Shaw opened SPR-10536 and commented

DefaultCacheAwareContextLoaderDelegate.loadContext() synchronizes access to the ContextCache which means that ApplicationContexts cannot be initialized in parallel.

I tried removing the ContextCache altogether, but this uncovered a deadlock in AbstractBeanFactory. Trying to fix that with a shared lock caused some race condition to autowire a null Environment into a @Configuration class' field.


Affects: 3.2.2

Issue Links:

  • #19400 No bean of type ConfigurableEnvironment in AbstractTestNGSpringContextTests
  • #17517 ApplicationContext fails to load in TestNG test if previous test is annotated with @DirtiesContext
  • #10532 Allow for concurrent test execution in the TestContext framework

1 votes, 3 watchers

spring-projects-issues avatar May 07 '13 06:05 spring-projects-issues

Sam Brannen commented

This issue is closely related to #10532.

spring-projects-issues avatar Oct 20 '13 11:10 spring-projects-issues