From c8026dc714792ff5229ff7798b2417785a90e32b Mon Sep 17 00:00:00 2001 From: drewhk Date: Wed, 3 Aug 2016 11:43:55 +0200 Subject: [PATCH] #20638: Harden TickSourceSpec (#21095) --- .../scala/akka/stream/scaladsl/TickSourceSpec.scala | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/TickSourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/TickSourceSpec.scala index 93b94a5cbe..5549bb3704 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/TickSourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/TickSourceSpec.scala @@ -15,12 +15,9 @@ class TickSourceSpec extends StreamSpec { "A Flow based on tick publisher" must { "produce ticks" in assertAllStagesStopped { val c = TestSubscriber.manualProbe[String]() - Source.tick(1.second, 500.millis, "tick").to(Sink.fromSubscriber(c)).run() + Source.tick(1.second, 1.second, "tick").to(Sink.fromSubscriber(c)).run() val sub = c.expectSubscription() - sub.request(3) - c.expectNoMsg(600.millis) - c.expectNext("tick") - c.expectNoMsg(200.millis) + sub.request(2) c.expectNext("tick") c.expectNoMsg(200.millis) c.expectNext("tick") @@ -84,16 +81,14 @@ class TickSourceSpec extends StreamSpec { "be possible to cancel" in assertAllStagesStopped { val c = TestSubscriber.manualProbe[String]() - val tickSource = Source.tick(1.second, 500.millis, "tick") + val tickSource = Source.tick(1.second, 1.second, "tick") val cancellable = tickSource.to(Sink.fromSubscriber(c)).run() val sub = c.expectSubscription() - sub.request(3) + sub.request(2) c.expectNoMsg(600.millis) c.expectNext("tick") c.expectNoMsg(200.millis) c.expectNext("tick") - c.expectNoMsg(200.millis) - c.expectNext("tick") cancellable.cancel() awaitCond(cancellable.isCancelled) sub.request(3)