-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Akka.TestKit: EventFilter.Expect_Async
waits full expect-msg-after
period even if internal method has already finished
#7173
Comments
Are there any other async TestKit methods that behave like this @Arkatufus ? |
This is by design, when you set akka.net/src/core/Akka.TestKit/EventFilter/Internal/EventFilterApplier.cs Lines 564 to 575 in ba3639e
To shorten the time, set the timeout value to less than 3 seconds. |
An improvement to this is to disallow setting |
The reproduction code is slightly suspect, if the unit test is supposed to check that the actor did not crash during startup, then the actor creation itself should be inside the filter. |
The |
Version Information
Version of Akka.NET? v1.5.19 and later
Which Akka.NET Modules? Akka.TestKit
Describe the bug
Consider the following reproduction test:
i = await actor.Ask<int>(TimerActor.Check.Instance);
completes in under 100ms. The test still waits a full 3 seconds to exit.Expected behavior
The way all of the assertions in the TestKit should be designed is exit as soon as:
Actual behavior
Right now it looks like we're waiting FOR BOTH of these things to complete. This might be adding significant execution time to the entire Akka.NET test suite.
The text was updated successfully, but these errors were encountered: