Less fragile way of waiting for stream completion #24501 (#24528)

This commit is contained in:
Johan Andrén 2018-02-12 14:38:22 +01:00 committed by Konrad `ktoso` Malawski
parent 5e6662c97c
commit 4cde6e7feb
2 changed files with 9 additions and 8 deletions

View file

@ -47,8 +47,8 @@ class RecipeAdhocSource extends RecipeSpec {
.runWith(TestSink.probe[String])
sink.requestNext("a")
Thread.sleep(500)
shutdown.isCompleted should be(true)
Thread.sleep(200)
shutdown.future.futureValue should be(Done)
}
"not shut down the source when there are still demands" taggedAs TimingTest in {
@ -88,8 +88,8 @@ class RecipeAdhocSource extends RecipeSpec {
sink.requestNext("a")
startedCount.get() should be(1)
Thread.sleep(500)
shutdown.isCompleted should be(true)
Thread.sleep(200)
shutdown.future.futureValue should be(Done)
}
"restart up to specified maxRetries" taggedAs TimingTest in {