From 7f189366b99cb3eaeb2bb14589cb06f2762af1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Antonsson?= Date: Mon, 3 Feb 2014 11:54:13 +0100 Subject: [PATCH] =act #3857 Ensure that only relevant test messages go to dead letters * Since there was no sender for the `Create` message in the test, the created `ActorRef` was also sent to dead letters, creating a race where the test could start to subscribe _too early_ and receive the `ActorRef` instead of the expected string. --- .../src/test/scala/akka/actor/ActorSelectionSpec.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala index aee06caf70..27f6c43be1 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorSelectionSpec.scala @@ -343,6 +343,8 @@ class ActorSelectionSpec extends AkkaSpec("akka.loglevel=DEBUG") with DefaultTim } "send ActorSelection wildcard targeted to missing actor to deadLetters" in { + val creator = TestProbe() + implicit def self = creator.ref val top = system.actorOf(p, "top") top ! Create("child1") top ! Create("child2")