From 22191620fd8c541580ee3c5d43c7d07808bfe7dd Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Wed, 6 May 2015 17:03:04 +0200 Subject: [PATCH] =act #17002 Harden ActorSystemSpec --- .../src/test/scala/akka/actor/ActorSystemSpec.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala index 76624d0ce6..0a80ca1a6f 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala @@ -260,7 +260,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend "reliable deny creation of actors while shutting down" in { val system = ActorSystem() import system.dispatcher - system.scheduler.scheduleOnce(200 millis) { system.terminate() } + system.scheduler.scheduleOnce(100 millis) { system.terminate() } var failing = false var created = Vector.empty[ActorRef] while (!system.whenTerminated.isCompleted) { @@ -268,6 +268,7 @@ class ActorSystemSpec extends AkkaSpec(ActorSystemSpec.config) with ImplicitSend val t = system.actorOf(Props[ActorSystemSpec.Terminater]) failing should not be true // because once failing => always failing (it’s due to shutdown) created :+= t + if (created.size % 1000 == 0) Thread.sleep(20) // in case of unfair thread scheduling } catch { case _: IllegalStateException ⇒ failing = true }