score:0
Solved this.
Tried to replace lazy val with def, as answered in this question: Testing: FakeApplication ignoring additionalConfiguration
Which solved the problem.
Would love if someone could explain why?
score:0
This problem bit me because I was holding on to Application state in the code. Since tests typically each get their own FakeApplication
, squireled-away state from one FakeApplication
instance, when used in the context of another FakeApplication
instance, will lead to problems. A concrete example is play.api.Play.current
- this needs to be re-evaluated for each FakeApplication
instance and shouldn't be held (after being evaluated only once) in your code.
Source: stackoverflow.com
Related Query
- Pool has been Shutdown (HikariDataSource) when testing
- How to get past SQLException: Attempting to obtain a connection from a pool that has already been shutdown
- Apache IVY error message? : impossible to get artifacts when data has not been loaded
- impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3
- In Scala, other than inheritance is there a technique to know when a base class method has been called?
- Type mismatch even when Vector type has been declared
- Apache Spark: what happens when one uses a host object value within a worker that has not been broadcasted?
- Log after actor system has been shutdown
- Is it possible to get a callback when data fed into a Play Concurrent.unicast Enumerator's channel has been processed?
- ERROR StandaloneSchedulerBackend: Application has been killed. Reason: All masters are unresponsive! Giving up. when running Spark in CRON
- Trying to compile gensort.scala, getting: [error] impossible to get artifacts when data has not been loaded. IvyNode =net.java.dev.jets3t#jets3t;0.6.1
- "SparkContext has been shutdown" when using df.select("Column Name") in Scala
- Adaptation of argument list by inserting () has been deprecated
- How to turn json to case class when case class has only one field
- Spark UDF called more than once per record when DF has too many columns
- Why does Scala have classes when it already has traits?
- Can I check whether a lazy val has been evaluated in Scala?
- How can one verify messages sent to self are delivered when testing Akka actors?
- Finding elements in a scala list and also know which predicate has been satisfied
- (/home/user/.sbt) has been deprecated. Please use the standard location: /home/user/project?
- Why does Akka fail with "IllegalStateException: cannot create children while terminating or terminated" when testing with ScalaTest?
- Spark SQL has no SparkSqlParser.scala file when compiling in intelliJ idea
- Reduce testing overhead when DAO contains action
- Play: Restart on code change takes long to shutdown and starting the Hikary Pool
- How to run subprojects tests (including setup methods) sequentially when testing
- Spark SQL fails because "Constant pool has grown past JVM limit of 0xFFFF"
- Akka Flow hangs when making http requests via connection pool
- java.lang.RuntimeException: There is no started application error, when testing a class from scala worksheet
- How to check if a class file version 50.0 (Java 6) has been preverified?
- Failing maven-build when Gatling-test has too high fail-percentage
More Query from same tag
- Convert Rdd[Vector] to Rdd[Double]
- Scala shapeless selection from HList of dependent types problem
- How to create a new repo in git from the sbt file?
- Context Bound on a Generic Class Using Implicits
- Scala: can't write setter without getter?
- How to write a Muller C Element in Chisel Scala Language for async circuit?
- Akka AssociationError - LAN address vs localhost
- DataType verification on DataFrame Scala
- Can we set remove column names from s3 partition path and set path to values?
- Registering serializers in Storm config
- Annotation based Scala Json validation for Case Class
- Useful Debugging in Flink
- chain style + scala options
- Pattern matching type mismatch error
- How can I supply multiple conditions in spark startsWith() function?
- Scala Compiler Plugin Deconstruction
- Reducing shuffle disk usage in Spark aggregations
- Using Scala Jackson for JSON deserialization?
- Finatra - unable to update cookie
- How to stop execution in for-comprehension if Option is None using cats IO?
- Error: bulkCopyToSqlDB is not a member of org.apache.spark.sql.DataFrameWriter
- FlatMap or For-comprehension on a Nested Options Monad
- Type parameter of minBy[B](f: ((A, B)) ⇒ B)(implicit cmp: Ordering[B]): (A, B)
- Purpose of PartialOrdering in Scala library
- How does Spark streaming and Dstream work?
- Ask for an example showing how immutability contributes to Scala's concurrency mechanism
- Avoid duplicated computation in guards
- Is it possible to have two different sbt versions for a project simultaneously
- Scala object for importing all methods
- Comparison of performance between Scala etc. and C/C++/Fortran?