Skip to content

Akka.TestKit: all tests should be asynchronous #90

@Aaronontheweb

Description

@Aaronontheweb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AK2000API usage rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions