+str #17418: Improved error handling for termination cases in Interpreter
This commit is contained in:
parent
ba3a69369f
commit
17733e5a54
3 changed files with 44 additions and 15 deletions
|
|
@ -3,6 +3,9 @@
|
|||
*/
|
||||
package akka.stream.impl.fusing
|
||||
|
||||
import akka.stream.stage._
|
||||
|
||||
import scala.util.control.NoStackTrace
|
||||
import akka.stream.Supervision
|
||||
|
||||
class InterpreterSpec extends InterpreterSpecKit {
|
||||
|
|
@ -496,6 +499,25 @@ class InterpreterSpec extends InterpreterSpecKit {
|
|||
lastEvents() should be(Set(OnNext("foo"), OnComplete))
|
||||
}
|
||||
|
||||
"report error if pull is called while op is terminating" in new TestSetup(Seq(new PushPullStage[Any, Any] {
|
||||
override def onPull(ctx: Context[Any]): SyncDirective = ctx.pull()
|
||||
override def onPush(elem: Any, ctx: Context[Any]): SyncDirective = ctx.pull()
|
||||
override def onUpstreamFinish(ctx: Context[Any]): TerminationDirective = ctx.absorbTermination()
|
||||
})) {
|
||||
lastEvents() should be(Set.empty)
|
||||
|
||||
downstream.requestOne()
|
||||
lastEvents() should be(Set(RequestOne))
|
||||
|
||||
upstream.onComplete()
|
||||
val ev = lastEvents()
|
||||
ev.nonEmpty should be(true)
|
||||
ev.forall {
|
||||
case OnError(_: IllegalStateException) ⇒ true
|
||||
case _ ⇒ false
|
||||
} should be(true)
|
||||
}
|
||||
|
||||
"implement expand-filter" in pending
|
||||
|
||||
"implement take-conflate" in pending
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue