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 ce49e407f4..271e039c2c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSystemSpec.scala @@ -288,7 +288,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) { @@ -296,6 +296,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 }