From 428f3896761b590e1fe3d753d449941e220bac02 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Tue, 18 May 2021 04:17:26 +0700 Subject: [PATCH] Fix AkkaProtocolStressTest spec --- .../Transport/AkkaProtocolStressTest.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/Akka.Remote.Tests/Transport/AkkaProtocolStressTest.cs b/src/core/Akka.Remote.Tests/Transport/AkkaProtocolStressTest.cs index 1a48a618a79..ace0cd656d1 100644 --- a/src/core/Akka.Remote.Tests/Transport/AkkaProtocolStressTest.cs +++ b/src/core/Akka.Remote.Tests/Transport/AkkaProtocolStressTest.cs @@ -16,6 +16,7 @@ using Akka.TestKit.TestEvent; using Akka.Util.Internal; using Xunit; +using Xunit.Abstractions; namespace Akka.Remote.Tests.Transport { @@ -163,14 +164,15 @@ private IActorRef Here get { Sys.ActorSelection(RootB / "user" / "echo").Tell(new Identify(null), TestActor); - return ExpectMsg(TimeSpan.FromSeconds(300)).Subject; + var subject = ExpectMsg(TimeSpan.FromSeconds(3)).Subject; + return subject; } } #endregion - public AkkaProtocolStressTest() : base(AkkaProtocolStressTestConfig) + public AkkaProtocolStressTest(ITestOutputHelper output) : base(AkkaProtocolStressTestConfig, output) { systemB = ActorSystem.Create("systemB", Sys.Settings.Config); remote = systemB.ActorOf(Props.Create(), "echo"); @@ -178,7 +180,7 @@ public AkkaProtocolStressTest() : base(AkkaProtocolStressTestConfig) #region Tests - [Fact(Skip = "Extremely racy")] + [Fact] public void AkkaProtocolTransport_must_guarantee_at_most_once_delivery_and_message_ordering_despite_packet_loss() { //todo mute both systems for deadletters for any type of message @@ -190,7 +192,12 @@ public void AkkaProtocolTransport_must_guarantee_at_most_once_delivery_and_messa new FailureInjectorTransportAdapter.Drop(0.1, 0.1))); AwaitCondition(() => mc.IsCompleted && mc.Result, TimeSpan.FromSeconds(3)); - var here = Here; + IActorRef here = null; + AwaitCondition(() => + { + here = Here; + return here != null && !here.Equals(ActorRefs.Nobody); + }, TimeSpan.FromSeconds(3)); var tester = Sys.ActorOf(Props.Create(() => new SequenceVerifier(here, TestActor))); tester.Tell("start");