From 4cf66549be7f2d4951ccdb00eab398a0645d0f3c Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 13 Aug 2021 14:40:43 +0000 Subject: [PATCH] Fix LazySourceSpec instability Don't make claims about whether this stage has completed. Fixes #30492 --- .../test/scala/akka/stream/scaladsl/LazySourceSpec.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazySourceSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazySourceSpec.scala index c19fe5bcb1..98258c846a 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazySourceSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/scaladsl/LazySourceSpec.scala @@ -124,7 +124,7 @@ class LazySourceSpec extends StreamSpec with DefaultTimeout with ScalaFutures { "never construct the source when there was no demand" in assertAllStagesStopped { val constructed = new AtomicBoolean(false) - val result = Source + Source .lazySource { () => constructed.set(true); Source(List(1, 2, 3)) } @@ -132,7 +132,6 @@ class LazySourceSpec extends StreamSpec with DefaultTimeout with ScalaFutures { .run() constructed.get() should ===(false) - result.isCompleted should ===(false) } "fail the materialized value when downstream cancels without ever consuming any element" in assertAllStagesStopped { @@ -271,7 +270,7 @@ class LazySourceSpec extends StreamSpec with DefaultTimeout with ScalaFutures { "never construct the source when there was no demand" in assertAllStagesStopped { val constructed = new AtomicBoolean(false) - val result = Source + Source .lazyFutureSource { () => Future { constructed.set(true) @@ -282,7 +281,6 @@ class LazySourceSpec extends StreamSpec with DefaultTimeout with ScalaFutures { .run() constructed.get() should ===(false) - result.isCompleted should ===(false) } "fail the materialized value when downstream cancels without ever consuming any element" in assertAllStagesStopped {