From 69bf24ee15a3c287f23d418893b1c69e9880cb81 Mon Sep 17 00:00:00 2001 From: Daniel Urban Date: Thu, 30 Nov 2017 22:02:32 +0100 Subject: [PATCH] Try to eliminate race condition in QueueSpec --- core/jvm/src/test/scala/fs2/async/QueueSpec.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/jvm/src/test/scala/fs2/async/QueueSpec.scala b/core/jvm/src/test/scala/fs2/async/QueueSpec.scala index 32a812d46f..f665b398a8 100644 --- a/core/jvm/src/test/scala/fs2/async/QueueSpec.scala +++ b/core/jvm/src/test/scala/fs2/async/QueueSpec.scala @@ -147,9 +147,9 @@ class QueueSpec extends Fs2Spec { f <- async.start(q.peek1) g <- async.start(q.peek1) _ <- q.enqueue1(42) - b <- q.offer1(43) x <- f y <- g + b <- q.offer1(43) z <- q.peek1 } yield List(b, x, y, z) )).flatten shouldBe Vector(true, 42, 42, 43) @@ -174,13 +174,11 @@ class QueueSpec extends Fs2Spec { q <- async.synchronousQueue[IO, Int] none1 <- q.timedPeek1(100.millis, scheduler) _ <- async.start(q.enqueue1(42)) - f <- async.start(q.timedPeek1(1000.millis, scheduler)) x <- q.dequeue1 - y <- f none2 <- q.timedPeek1(100.millis, scheduler) - } yield List(none1, x, y, none2) + } yield List(none1, x, none2) ) - }).flatten shouldBe Vector(None, 42, Some(42), None) + }).flatten shouldBe Vector(None, 42, None) } "peek1 synchronous None-terminated queue" in { runLog(Stream.eval(