I have a collection of integration tests running with `SpringJUnit4ClassRunner`. I'm trying to run these in parallel using maven surefire. However, I have noticed that the the code is blocking before entering the synchronized block in `CacheAwareContextLoaderDelegate.loadContext()`.

Is there a way to bypass this cache? I tried doing this, but it seems like there is more shared state than just the cache itself since my application deadlocked inside Spring code. Or could the synchronization be made more fine-grained by somehow synchronizing on the map key rather than the entire map?

My motivation for parallelising tests is twofold:

1. In some tests, I replace beans with mocks. Since mocks are inherently stateful, I have to build a fresh ApplicationContext for every test method using `@DirtiesContext`.
2. In other tests, I only want to deploy a subset of Jersey resources. To do this, I specify a subset of Spring configuration classes. Since Spring uses the `MergedContextConfiguration` as a key in the context cache, these tests will be unable to share ApplicationContexts.