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.Persistence.Tests: fixed ordering assertion in AtLeastOnceDelivery_must_warn_about_unconfirmed_messages #6396

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/core/Akka.Persistence.Tests/AtLeastOnceDeliverySpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
using System.Collections.Generic;
using System.Linq;
using Akka.Actor;
using Akka.Actor.Dsl;
using Akka.Event;
using Akka.TestKit;
using Akka.TestKit.Xunit2.Attributes;
using Xunit;
using Xunit.Abstractions;
using FluentAssertions;

namespace Akka.Persistence.Tests
{
Expand Down Expand Up @@ -574,13 +574,13 @@ public void AtLeastOnceDelivery_must_warn_about_unconfirmed_messages()
ExpectMsg(ReqAck.Instance);

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

var resultDestinations = unconfirmed.Select(x => x.Destination).Distinct().ToArray();
resultDestinations.ShouldOnlyContainInOrder(probeA.Ref.Path, probeB.Ref.Path);
resultDestinations.Should().BeEquivalentTo(probeA.Ref.Path, probeB.Ref.Path);
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"));
resultMessages.Should().BeEquivalentTo(new Action(1, "a-1"), new Action(2, "b-1"), new Action(3, "b-2"));

Sys.Stop(sender);
}
Expand Down