Hi there, in general we do not encourage the use of TestActorRef - the way it works is by forcing the CallingThreadDispatcher, which does not mix well with Actors which need to perform work in the background. For example PersistentActors need to execute recovery etc (if you're using AtLeastOnceDelivery it means you must be using Persistence already).
Summing up, the solution is to not use TestActorRef. In the tests you show you are not using any of TestActorRefs features anyway, so removing should be painless indeed :-) Related ticket: https://github.com/akka/akka/issues/15293 Happy hakking! On Wed, May 27, 2015 at 11:17 AM, Giampaolo <[email protected]> wrote: > Hi to all, > I have something strange that I cannot understand. > > I have this test that worked very well > > "give online status NeverLogged for never logged user" in new > WithUsersData() { > val auth = createAndAuthenticateUser > val user1 = auth._1 > val sid1 = auth._2 > > val tp1 = TestProbe() > > val dispatcher1 = TestActorRef(DispatcherActor.props(tp1.ref)) > > dispatcher1 ! Presence("rid_test2", sid1) > tp1.expectMsgType[Notification.Presence] > > } > > > Then I added AtLeastOnceDelivery trait to the DispatcherActor for > messages it needs to send to other actors. Keep in mind that in my test, > dispatcher1 is receiving a message, not sending one. It broke my tests. > It seems to me that dispatcher1 is not ready when I fire the Presence > message, since I see no logging from that actor. However if I change the > code this way: > > for(i <- 0 to 0){ > > dispatcher1 ! Presence("rid_test2", sid1) > > } > > > or in this way > > Thread.sleep(50) > > dispatcher1 ! Presence("rid_test2", sid1) > > > Test is successful. Could you give me some advice in investigating this > problem? > > Thank you in advance for your precious time. > > > Giampaolo > > > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
