You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version Information
Akka.TestKit.Xunit2 1.5.15 and upwards (works with 1.5.14)
Describe the bug
FishForMessage in combination with tell on an actor with async receive handler that calls "Tell" on the test probe that triggered the handler.
To Reproduce
Steps to reproduce the behavior:
Execute Unittest with debugger:
using System;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.TestKit.Xunit2;
using Xunit;
namespace CODESYS.CAS.TaskManager.UnitTests;
public class Foobar : TestKit
{
private class AsyncActor : ReceiveActor
{
private readonly IActorRef _probe;
public AsyncActor(IActorRef probe)
{
_probe = probe;
ReceiveAnyAsync(async msg =>
{
_probe.Tell(msg);
await Task.CompletedTask;
});
}
}
[Fact]
public async Task Deadlock()
{
var probe = CreateTestProbe();
var testee = Sys.ActorOf(Props.Create(() => new AsyncActor(probe)));
var msg = 123;
testee.Tell("foobar");
testee.Tell(msg);
await probe.FishForMessageAsync(m => m.Equals(msg), TimeSpan.FromDays(1));
}
}
Unittest deadlocks
Pause debugger: unittest is deadlocked on _probe.Tell(msg);
Expected behavior
Unittest should pass - no deadlock should occur.
Actual behavior
The unittest deadlocked.
Environment
Windows, .net 8
The text was updated successfully, but these errors were encountered:
Version Information
Akka.TestKit.Xunit2 1.5.15 and upwards (works with 1.5.14)
Describe the bug
FishForMessage in combination with tell on an actor with async receive handler that calls "Tell" on the test probe that triggered the handler.
To Reproduce
Steps to reproduce the behavior:
_probe.Tell(msg);
Expected behavior
Unittest should pass - no deadlock should occur.
Actual behavior
The unittest deadlocked.
Environment
Windows, .net 8
The text was updated successfully, but these errors were encountered: