Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does test fail with both "TestsFailedException" and "Failed 0, Errors 0"

Intermittently some ScalaTest test runs fail with this contradictory output:

...
akka.pattern.AskTimeoutException: Timed out
    at akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:334)
    at akka.actor.Scheduler$$anon$11.run(Scheduler.scala:118)
    at scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:694)
    at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:691)
    at akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:455)
    at akka.actor.LightArrayRevolverScheduler$$anon$12.executeBucket$1(Scheduler.scala:407)
    at akka.actor.LightArrayRevolverScheduler$$anon$12.nextTick(Scheduler.scala:411)
    at akka.actor.LightArrayRevolverScheduler$$anon$12.run(Scheduler.scala:363)
    at java.lang.Thread.run(Thread.java:744)
[error] Could not run test com.example.Spec: akka.pattern.AskTimeoutException: Timed out
...
[info] ScalaTest
[info] Run completed in 20 seconds, 772 milliseconds.
[info] Total number of tests run: 64
[info] Suites: completed 12, aborted 0
[info] Tests: succeeded 64, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[error] Error: Total 64, Failed 0, Errors 0, Passed 64
[error] Error during tests:
[error]     com.example.Spec
[error] (price-finder/test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 78 s, completed Jul 24, 2014 12:37:10 PM

How can I prevent these failures? If the test code is successful, I don't want the thrown exception to cause the test run to fail.

like image 979
David Resnick Avatar asked Dec 31 '25 08:12

David Resnick


1 Answers

ScalaTest itself does not distinguish between errors and failures. Sbt does, though, as do JUnit and specs2. Is it possible you have a test written for a different test framework in the mix? In particular, what does com.example.Spec look like?

like image 86
Bill Venners Avatar answered Jan 02 '26 14:01

Bill Venners



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!