Testing akka actor termination

When testing akka code, I want to make sure a particular actor gets shut down within a time limit. I used to do it like this:  Thread.sleep(2.seconds) assertTrue(actorRef.isTerminated()) That isTerminated method is deprecated since Akka 2.2, and good thing too, since my test was wasting everyone’s time. Today I’m doing this instead: import akka.testkit.TestProbeval probe = …

Read moreTesting akka actor termination

Weakness and Vulnerability

Weakness and vulnerability are different. Separate the concerns: [1] Vulnerability is an openness to being wounded.Weakness is inability to live through wounds. In D&D terms: vulnerability is a low armor class, weakness is low hit points. Armor class determines how hard it is for an enemy to hit you, and hit points determine how many hits …

Read moreWeakness and Vulnerability

Testing akka: turn on debug

Testing is easier when you can see what messages are received by your actors. To do this, add logging to your real code, and then change your configuration. This post shows how to hard-code some debugging configuration for testing purposes. Step 1: put logging into your receive method, by wrapping your existing receive definition in …

Read moreTesting akka: turn on debug