=str #17407: MapAsync should pull when failed futures free up space
This commit is contained in:
parent
9125a719fe
commit
7f6a67a5c0
3 changed files with 38 additions and 6 deletions
|
|
@ -122,6 +122,21 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec {
|
|||
.expectComplete()
|
||||
}
|
||||
|
||||
"resume after multiple failures" in assertAllStagesStopped {
|
||||
val futures: List[Future[String]] = List(
|
||||
Future.failed(Utils.TE("failure1")),
|
||||
Future.failed(Utils.TE("failure2")),
|
||||
Future.failed(Utils.TE("failure3")),
|
||||
Future.failed(Utils.TE("failure4")),
|
||||
Future.failed(Utils.TE("failure5")),
|
||||
Future.successful("happy!"))
|
||||
|
||||
Await.result(
|
||||
Source(futures)
|
||||
.mapAsyncUnordered(2)(identity).withAttributes(supervisionStrategy(resumingDecider))
|
||||
.runWith(Sink.head), 3.seconds) should ===("happy!")
|
||||
}
|
||||
|
||||
"finish after future failure" in assertAllStagesStopped {
|
||||
import system.dispatcher
|
||||
Await.result(Source(1 to 3).mapAsyncUnordered(1)(n ⇒ Future {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue