Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play tests failing in Eclipse only due to CacheManager being shutdown #58

Open
rgladwell opened this issue Feb 3, 2016 · 0 comments
Open

Comments

@rgladwell
Copy link

When running Scalatest integration tests for Play2 using the scalatestplus API some tests fail with the following error message:

Unable to provision, see the following errors:

1) Error in custom provider, java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.
 at play.api.cache.EhCacheModule.play$api$cache$EhCacheModule$$bindCache$1(Cache.scala:178):
Binding(interface net.sf.ehcache.Ehcache qualified with QualifierInstance(@play.cache.NamedCache(value=play)) to ProviderTarget(play.api.cache.NamedEhCacheProvider@7bbaf6fc)) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
 while locating net.sf.ehcache.Ehcache annotated with @play.cache.NamedCache(value=play)
 at play.api.cache.EhCacheModule.play$api$cache$EhCacheModule$$bindCache$1(Cache.scala:179):
Binding(interface play.api.cache.CacheApi qualified with QualifierInstance(@play.cache.NamedCache(value=play)) to ProviderTarget(play.api.cache.NamedCacheApiProvider@381eb99)) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
 while locating play.api.cache.CacheApi annotated with @play.cache.NamedCache(value=play)
 while locating play.api.cache.CacheApi

I suspect this is a fault with scalatest-eclipse-plugin due to the fact the tests pass OK from the sbt CLI.

Tests pass successfully in Eclipse if the single, faulty suite runs on its own.

Perhaps some kind of difference in the life-cycle?

Expected result: tests should pass, as they do when you execute sbt test from the command line.

Actual result: Tests fail even though they pass from the CLI sbt.

I can't reproduce in a test case project. Neither can I provide my code (which is proprietary). But here is some example code that is very similar to the code that is failing for me: https://github.com/rgladwell/scalatest-eclipse-with-play

Workaround: Replacing OneAppPerSuite with OneAppPerTest seems to resolve the issue (but increases repetition).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant