TestActorRef
can not catch exceptions on asynchronous methods
#6265
Labels
Milestone
TestActorRef
can not catch exceptions on asynchronous methods
#6265
Version Information
Version of Akka.NET?
Akka 1.4.46
Which Akka.NET Modules?
Akka.TestKit 1.4.46
,xunit 2.4.1
Describe the bug
I am attempting to test the behavior of Actors. I am not very good at it yet, so every once in a while there is an exception, and the test just swallows the exception, and I have to go search why
ExpectMsg
is timing out.I have found the best way to test the actor behavior is with
TestActorRef.Receive
, but it only works for synchronous methods.To Reproduce
Test actor:
This test fails (Expected behavior):
This test does not fail (Not expected behavior):
Expected behavior
To have a
ReceiveAsync
method for asynchronous method handling.OR
Some mechanism that automatically watches for any unhandled exceptions in tests, and have the test failure display the information.
Actual behavior
Unhandled exceptions disappear.
Environment
.NET Core v7 on Windows
Additional context
I am fairly new to akka.net, but I am loving it. I am following the instructions on Testing Actor Systems, and it feels like I am missing something. Are there no better ways to watch that unhandled exceptions exist?
The text was updated successfully, but these errors were encountered: