-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: testIssues in the test moduleIssues in the test modulestatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Juraj Misur opened SPR-12687 and commented
If I use @DirtiesContext annotation together with shared (or not) ehcache instance, it does not properly reinitialize the cache, thus taking existing shutdown cache into fresh context.
See attached project.
- By running
mvn test -Dshared=true3rd test fails on
java.lang.IllegalStateException: The strings Cache is not alive (STATUS_SHUTDOWN) - By running
mvn test -Dshared=false2nd fails onnet.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM
The only difference between tests is that CachebugApplication2Test have different context configuration + @DirtiesContext annotation.
If you make CachebugApplication2Test configuration the same as 1Test and 2Test, the tests succeed. Also different behavior can be observed when commenting out @DirtiesContext annotation.
The tests should run together, in order: CachebugApplication1Test , CachebugApplication2Test , CachebugApplication3Test
Affects: 3.2.8, 4.1.4
Attachments:
- cachebug.zip (3.97 kB)
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)in: testIssues in the test moduleIssues in the test modulestatus: invalidAn issue that we don't feel is validAn issue that we don't feel is valid