Akka TestKit fails...

17 views
Skip to first unread message

Objekt Werks

unread,
Oct 26, 2015, 6:47:40 AM10/26/15
to scalatest-users
Hey, Bill

Thanks for all your hard work on ScalaTest. It's all I use.

So, I upgraded to 3.0.0-M10 from 2.2.5. And all my Akka tests passed. Oddly enough, my single Akka TestKit test failed.:)

Here's the test:

Enter code here...package akka

import akka.actor._
import akka.testkit.{ImplicitSender, TestKit}
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}

import scala.concurrent.Await
import scala.concurrent.duration._

class Ping extends Actor with ActorLogging {
def receive = {
case ping: String => log.info(ping); sender ! ping
case _ => log.info("Ping received an invalid message.")
}
}

class TestKitTest extends TestKit(ActorSystem("testkit", Conf.config))
with ImplicitSender
with WordSpecLike
with Matchers
with BeforeAndAfterAll {
val ping: ActorRef = system.actorOf(Props[Ping], name = "ping")

override protected def afterAll(): Unit = {
Await.result(system.terminate(), 1 second)
}

"Ping actor" should {
"reply with an identical message" in {
within(2 seconds) {
ping ! "ping"
expectMsg("ping")
}
}
}
}

it blow up on line 32: expectMsg("ping"). Conf just load a named Akka config file.

Best Regards, Mike


Bill Venners

unread,
Oct 26, 2015, 6:50:59 AM10/26/15
to scalate...@googlegroups.com
Hi Mike,

Thanks for the report. Someone reported a similar issue a few days ago, so we went back to the drawing board. The implicit conversion method we used in M10 won't work. It has already been ejected. I'll have a new milestone release soon with an approach that has a bit more API surface area, but won't cause this kind of problem.

Bill

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bill Venners
Artima, Inc.
http://www.artima.com

Konrad Malawski

unread,
Oct 26, 2015, 5:18:28 PM10/26/15
to scalate...@googlegroups.com
That's very good to hear, thanks Bill for investigating!

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Typesafe
java.pl / geecon.org / krakowscala.pl / lambrakrk.pl / gdgkrakow.pl
Reply all
Reply to author
Forward
0 new messages