【发布时间】:2020-09-26 07:00:52
【问题描述】:
我创建了一个简单的测试场景来展示这一点:
class Test extends AsyncFunSuite {
test("async test") {
val f = Future {
val thread = new Thread {
override def run(): Unit = {
println("OKAYY")
}
}
thread.start()
}
Await.result(f, Duration.Inf)
Future {
assert(true)
}
}
}
执行此操作时,测试将永远运行并且永远不会完成。
【问题讨论】:
标签: scala asynchronous future scalatest