Skip to content

Commit

Permalink
Print fiber info on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Dec 30, 2024
1 parent ef5d6e4 commit 6dcf4f8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ class FiberMonitorSuite extends BaseSuite with TestInstances {
_ <- IO(assertEquals(snapshot.size, 2)) // root and awaiting fibers
fiberSnapshot <- IO(snapshot.filter(_.contains(fiberId)))
_ <- IO(assertEquals(fiberSnapshot.size, 1)) // only awaiting fiber
_ <- IO(assert(fiberSnapshot.exists(_.matches(waitingPattern))))
_ <- IO(
assert(fiberSnapshot.exists(_.matches(waitingPattern)), fiberSnapshot.mkString("\n"))
)

_ <- cdl.release // allow further execution
outcome <- fiber.join
_ <- IO.sleep(100.millis)

_ <- IO(assertEquals(outcome, Outcome.succeeded[IO, Throwable, Unit](IO.unit)))
_ <- IO(assert(fiber.toString.matches(completedPattern)))
_ <- IO(assert(fiber.toString.matches(completedPattern), fiber.toString))
_ <- IO(assertEquals(makeSnapshot(runtime).size, 1)) // only root fiber
} yield ()
}
Expand Down

0 comments on commit 6dcf4f8

Please sign in to comment.