In my tests of event sourced actors with EventSourcedBehaviorTestKit.runCommand
I noticed that if the code under test produces an error, the causing exception is not displayed. Instead the test kit only produces a timeout exception with an internal Akka stack trace and an error message like
java.lang.AssertionError: Timeout (1 second) during receiveMessage while waiting for message
There is no hint to the actual cause of the timeout. That makes it very difficult to localize the problem during the implementation of tests. Is it possible to enable such output?
Somewhat related is the case of commands that have the side effect of stopping the actor under test (with EffectBuilder.thenStop
). This also only causes the timeout described above, without a hint to the actual problem. Furthermore it makes it impossible to test commands that cause the target actor to stop. Is there another way to test “stopping” commands?