Skip to content

Akka.Actor / Akka.TestKit: add a built-in means of forcing actors to restart #7492

@Aaronontheweb

Description

@Aaronontheweb

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

Based on a discussion in our #premium-support Discord - it would be really helpful if there was some built-in way of triggering an actor to throw an exception and restart so we could test actor recovery inside TestKit tests.

Describe the solution you'd like

Something akin to the Kill message without shutting down the actor:

public sealed class Kill : IAutoReceivedMessage
{
private Kill() { }
/// <summary>
/// The singleton instance of Kill.
/// </summary>
public static Kill Instance { get; } = new();
public override string ToString()
{
return "<Kill>";
}
}

Describe alternatives you've considered

We could try to implement something inside the TestKit using the TestActorOf<TActor> method but I think this is a lot simpler by comparison.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions