-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Caleb Jones opened SPR-7996 and commented
Overview
Unit/integration test execution libraries can sometimes be configured to execute tests in a forked manner (see surefire's forkMode configuration). When tests are run in a forked mode, in-memory @ContextConfiguration
caching no longer applies, and the context will be reloaded for every forked process.
The Spring reference manual merely states that @ContextConfiguration
is cached and does not go into much detail beyond that. I think it would be good to specify that the cache is in-memory and thus will only be usable for tests which run within the same JVM process / class space. Perhaps a Spring note (the ones with the little leaf icon and block quote styling) would be good to call this out in the Testing chapter.
To Document
- cache key generation, including a discussion of the algorithm in
MergedContextConfiguration
- cache scope and implications in a test suite, including a discussion of forking
Affects: 2.5.6, 3.0.5
Reference URL: http://forum.springsource.org/showthread.php?t=104164
Issue Links:
- TestContext should generate cache keys based on all metadata that uniquely identify ApplicationContext configuration [SPR-7326] #11984 TestContext should generate cache keys based on all metadata that uniquely identify ApplicationContext configuration
- ContextCache should be keyed by MergedContextConfiguration instead of String [SPR-8549] #13193 ContextCache should be keyed by MergedContextConfiguration instead of String
Referenced from: commits e90c7ea