Skip to content
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: all tests should be asynchronous #90

Open
4 tasks
Aaronontheweb opened this issue Apr 11, 2024 · 1 comment
Open
4 tasks

Akka.TestKit: all tests should be asynchronous #90

Aaronontheweb opened this issue Apr 11, 2024 · 1 comment
Labels
AK2000 API usage rules

Comments

@Aaronontheweb
Copy link
Member

Is your feature request related to a problem? Please describe.

TL;DR; - all test methods should return a Task and use await-able methods in the TestKit. Goal behind this is to reduce blocking threads, which can have side effects on the test suite. This is something we've wanted for Akka.NET itself for years a way of combatting racy specs inside our own test suite.

Describe the solution you'd like

We're probably better off not going after the actual test members (i,e. Fact in xUnit) since the TestKit has to support multiple testing frameworks, but we should go after the individual methods called inside the TestKit

  • AwaitAssert --> AwaitAssertAsync
  • AwaitCondition --> AwaitConditionAsync
  • ExpectMsg --> ExpectMsgAsync
  • Watch --> WatchAsync

Describe alternatives you've considered

The default "there's an async overload of this method" C# tool can pick up some of this, but not most - especially in situations where the return type and input methods are different.

This would fall under AK2000 - API usage.

@Aaronontheweb Aaronontheweb added the AK2000 API usage rules label Apr 11, 2024
@Aaronontheweb
Copy link
Member Author

Not a complete list of TestKit methods we should try to make async, btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AK2000 API usage rules
Projects
None yet
Development

No branches or pull requests

1 participant