diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala index 86ae8197c4..71e210559c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala @@ -192,7 +192,9 @@ object SupervisorHierarchySpec { case x ⇒ (x, x) } override val supervisorStrategy = OneForOneStrategy()(unwrap andThen { - case _ if pongsToGo > 0 ⇒ Resume + case _: Failure if pongsToGo > 0 ⇒ + log :+= Event("pongOfDeath resuming " + sender) + Resume case (f: Failure, orig) ⇒ if (f.depth > 0) { setFlags(f.directive) @@ -225,6 +227,9 @@ object SupervisorHierarchySpec { context.watch(context.actorOf(props, name)) } } + if (context.children.size != state.kids.size) { + abort("invariant violated: " + state.kids.size + " != " + context.children.size) + } cause match { case f: Failure if f.failPost > 0 ⇒ f.failPost -= 1; throw f case PostRestartException(`self`, f: Failure, _) if f.failPost > 0 ⇒ f.failPost -= 1; throw f @@ -279,11 +284,14 @@ object SupervisorHierarchySpec { val kids = stateCache.get(self).kids(ref) val props = Props(new Hierarchy(kids, breadth, listener, myLevel + 1)).withDispatcher("hierarchy") context.watch(context.actorOf(props, name)) + } else { + log :+= Event(sender + " terminated while pongOfDeath") } case Abort ⇒ abort("terminating") case PingOfDeath ⇒ if (size > 1) { pongsToGo = context.children.size + log :+= Event("sending " + pongsToGo + " pingOfDeath") context.children foreach (_ ! PingOfDeath) } else { context stop self @@ -570,6 +578,7 @@ object SupervisorHierarchySpec { println(system.asInstanceOf[ActorSystemImpl].printTree) getErrors(hierarchy, 10) printErrors() + idleChildren foreach println testActor ! "timeout in Stopping" stop case Event(e: ErrorLog, _) ⇒ diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala index a1d32e019e..93ec04c752 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala @@ -31,7 +31,7 @@ object AkkaSpec { fork-join-executor { parallelism-min = 8 parallelism-factor = 2.0 - parallelism-max = 8 + parallelism-max = 18 } } }