Fix LazySourceSpec instability

Don't make claims about whether this stage has completed.

Fixes #30492
This commit is contained in:
Arnout Engelen 2021-08-13 14:40:43 +00:00
parent 999b0853d5
commit 4cf66549be
No known key found for this signature in database
GPG key ID: 061107B0F74A6DAA

View file

@ -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 {