Eric
Eric

Reputation: 1023

Scala-cli test doesnt exit after test run

I have some basic tests that i am executing with scala cli. When i run the tests scala-cli test core where core is the name of the directory where the tests are. the test run is finished but the process doesnt end. It just hangs there and even if i run it in debug mode i dont see what it is hanging on.

I was using the munit framework and i saw the this behavior but intermittently and then i switched to scalatest just to try and it happens all the time.

I had tests that tested futures and i thought that that might br the problem so i just had them run assert(true) just to see if i could isolte the problem.

When running with munit it seems to exit properly for some async tests but not for others. It seems to consistently exit when the tests are not async

Scalatest wont exit at all no matter if the tests are async or not

Has anyone else run into this?

=== edit === an example scalatest async test is

import org.scalatest.funspec.{AsyncFunSpec, AsyncFunSpecLike}
import org.scalatest.funsuite.AsyncFunSuite

class SlackAPITest extends AsyncFunSuite {
  implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global

  test("post message") {
    postMessage("whatever :chococat: :catbus: :catbus2:", testChannelId)
  }
}

where the postMessage method returns a Future[String]

Upvotes: 0

Views: 53

Answers (0)

Related Questions