Skip to content

Commit

Permalink
[combinators] fix flaky test (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil authored Jan 10, 2025
1 parent efd8ad1 commit 073d998
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ class ResourceCombinatorTest extends Test:
_ <- setter(50)
result <- IO(state)
yield result
val beforeResources = scala.concurrent.Future(assert(state == 0))
assert(state == 0)
val handledResources: Int < Async = Resource.run(effect)
Async.run(handledResources).map(_.toFuture).map { handled =>
for
assertion1 <- beforeResources
assertion2 <- handled.map(_ == 50)
assertion3 <- Future(assert(state == 0))
yield assertion3
assertion1 <- handled.map(_ == 50)
assertion2 <- Future(assert(state == 0))
yield assertion2
end for
}
}
Expand Down

0 comments on commit 073d998

Please sign in to comment.