Skip to content

Commit

Permalink
Merge branch 'dev' into bytestring-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Apr 11, 2024
2 parents 4b69e69 + 09a163e commit 411dcb5
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Event;
using Akka.TestKit;
Expand Down Expand Up @@ -564,13 +565,13 @@ public void PersistentReceive_must_restore_state_from_snapshot()
}

[Fact]
public void PersistentReceive_must_warn_about_unconfirmed_messages()
public async Task PersistentReceive_must_warn_about_unconfirmed_messages()
{
TestProbe probeA = CreateTestProbe();
TestProbe probeB = CreateTestProbe();
var probeA = CreateTestProbe();
var probeB = CreateTestProbe();

var destinations = new Dictionary<string, ActorPath> {{"A", probeA.Ref.Path}, {"B", probeB.Ref.Path}};
IActorRef sender =
var sender =
Sys.ActorOf(
Props.Create(
() =>
Expand All @@ -580,19 +581,19 @@ public void PersistentReceive_must_warn_about_unconfirmed_messages()
sender.Tell(new Req("a-1"));
sender.Tell(new Req("b-1"));
sender.Tell(new Req("b-2"));
ExpectMsg(ReqAck.Instance);
ExpectMsg(ReqAck.Instance);
ExpectMsg(ReqAck.Instance);
await ExpectMsgAsync(ReqAck.Instance);
await ExpectMsgAsync(ReqAck.Instance);
await ExpectMsgAsync(ReqAck.Instance);

UnconfirmedDelivery[] unconfirmed = ReceiveWhile(TimeSpan.FromSeconds(3), x =>
var unconfirmed = ReceiveWhile(TimeSpan.FromSeconds(3), x =>
x is UnconfirmedWarning warning
? warning.UnconfirmedDeliveries
: Enumerable.Empty<UnconfirmedDelivery>())
.SelectMany(e => e).ToArray();

ActorPath[] resultDestinations = unconfirmed.Select(x => x.Destination).Distinct().ToArray();
var resultDestinations = unconfirmed.Select(x => x.Destination).Distinct().ToArray();
resultDestinations.ShouldOnlyContainInOrder(probeA.Ref.Path, probeB.Ref.Path);
object[] resultMessages = unconfirmed.Select(x => x.Message).Distinct().ToArray();
var resultMessages = unconfirmed.Select(x => x.Message).Distinct().ToArray();
resultMessages.ShouldOnlyContainInOrder(new Action(1, "a-1"), new Action(2, "b-1"), new Action(3, "b-2"));

Sys.Stop(sender);
Expand Down

0 comments on commit 411dcb5

Please sign in to comment.