While working on zio-spark, we cannot race effects in Tests that are not using zio.Clock
. The effects are not interrupted. It's there a way to fix that?
package zio.spark.effect
import zio._
import zio.test.TestAspect.timeout
import zio.test._
object WeirdClocks extends DefaultRunnableSpec {
def wait(seconds: Int): UIO[Int] = UIO(Thread.sleep(seconds * 1000)).as(seconds)
override def spec: ZSpec[TestEnvironment, Any] = suite("clock")(
test("raceTest") {
wait(5).race(wait(15)) map (n => assertTrue(n == 5))
} @@ timeout(10.seconds)
)
}