David Resnick
David Resnick

Reputation: 4991

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.

Upvotes: 3

Views: 2332

Answers (2)

Puneeth Reddy V
Puneeth Reddy V

Reputation: 1578

These some possibilities why your branch is having such issues:-

  • It might have conflicts, resolve and re-run the tests
  • Git rebase is in progress, complete rebase and re-run those tests
  • Test dependencies are not meet in my case docker images are not up as I was running the test.

Upvotes: 0

Bill Venners
Bill Venners

Reputation: 21

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?

Upvotes: 2

Related Questions