Skip to content

Commit 370cb9a

Browse files
committed
ensure joinOrCancel test fiber actually starts
1 parent 73f9c6c commit 370cb9a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/shared/src/test/scala/cats/effect/IOSuite.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,19 +2247,19 @@ class IOSuite extends BaseScalaCheckSuite with DisciplineSuite with IOPlatformSu
22472247

22482248
real("joinOrCancel - gets result") {
22492249
for {
2250-
ready <- Deferred[IO, Unit]
2250+
ioaReady <- Deferred[IO, Unit]
2251+
fiberReady <- Deferred[IO, Unit]
22512252
requested <- Deferred[IO, Boolean]
2252-
ioa <- (ready.complete(()) *> requested.get)
2253+
ioa <- (ioaReady.complete(()) *> requested.get)
22532254
.onCancelRequested(requested.complete(true).void)
22542255
.onCancel(requested.complete(false).void)
22552256
.uncancelable
22562257
.start
2257-
fiber <- ioa
2258+
fiber <- (fiberReady.complete(()) *> ioa
22582259
.joinOrCancel
2259-
.flatMap(_.fold(IO.pure(false), _ => IO.pure(false), identity))
2260-
.uncancelable
2261-
.start
2262-
_ <- ready.get
2260+
.flatMap(_.fold(IO.pure(false), _ => IO.pure(false), identity))).uncancelable.start
2261+
_ <- ioaReady.get
2262+
_ <- fiberReady.get
22632263
_ <- fiber.cancel
22642264
fiberResult <- fiber.join.flatMap(_.fold(IO.pure(false), _ => IO.pure(false), identity))
22652265
requestedResult <- requested.get

0 commit comments

Comments
 (0)