Skip to content

Commit

Permalink
test: use >= in timers instead of strict >
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Mar 7, 2024
1 parent e61044e commit cde85f2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class StructuredConcurrencyTest extends AnyFunSpec with Matchers {
f2.await + " " + f1.await // note the inverted order w.r.t. the previous case
f.awaitResult.isFailure shouldBe true
val now = System.currentTimeMillis()
now - before should be > 2_000L
now - before should be >= 2_000L
stillAlive shouldBe true
}

Expand Down Expand Up @@ -78,7 +78,7 @@ class StructuredConcurrencyTest extends AnyFunSpec with Matchers {
val f2 = Future { sleep(2_000); stillAlive = true }
val result = f1.altWithCancel(f2).awaitResult
val now = System.currentTimeMillis()
now - before should (be > 1_000L and be < 5_000L)
now - before should (be >= 1_000L and be < 2_000L)
result.isSuccess shouldBe true
result.get shouldBe "faster won"
sleep(3_000)
Expand Down

0 comments on commit cde85f2

Please sign in to comment.