Skip to content

Commit 3f6182c

Browse files
Fix AkkaProtocolStressTest spec (#5020)
Co-authored-by: Aaron Stannard <[email protected]>
1 parent 1875c32 commit 3f6182c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/core/Akka.Remote.Tests/Transport/AkkaProtocolStressTest.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Akka.TestKit.TestEvent;
1717
using Akka.Util.Internal;
1818
using Xunit;
19+
using Xunit.Abstractions;
1920

2021
namespace Akka.Remote.Tests.Transport
2122
{
@@ -163,22 +164,23 @@ private IActorRef Here
163164
get
164165
{
165166
Sys.ActorSelection(RootB / "user" / "echo").Tell(new Identify(null), TestActor);
166-
return ExpectMsg<ActorIdentity>(TimeSpan.FromSeconds(300)).Subject;
167+
var subject = ExpectMsg<ActorIdentity>(TimeSpan.FromSeconds(3)).Subject;
168+
return subject;
167169
}
168170
}
169171

170172

171173
#endregion
172174

173-
public AkkaProtocolStressTest() : base(AkkaProtocolStressTestConfig)
175+
public AkkaProtocolStressTest(ITestOutputHelper output) : base(AkkaProtocolStressTestConfig, output)
174176
{
175177
systemB = ActorSystem.Create("systemB", Sys.Settings.Config);
176178
remote = systemB.ActorOf(Props.Create<Echo>(), "echo");
177179
}
178180

179181
#region Tests
180182

181-
[Fact(Skip = "Extremely racy")]
183+
[Fact]
182184
public void AkkaProtocolTransport_must_guarantee_at_most_once_delivery_and_message_ordering_despite_packet_loss()
183185
{
184186
//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
190192
new FailureInjectorTransportAdapter.Drop(0.1, 0.1)));
191193
AwaitCondition(() => mc.IsCompleted && mc.Result, TimeSpan.FromSeconds(3));
192194

193-
var here = Here;
195+
IActorRef here = null;
196+
AwaitCondition(() =>
197+
{
198+
here = Here;
199+
return here != null && !here.Equals(ActorRefs.Nobody);
200+
}, TimeSpan.FromSeconds(3));
194201

195202
var tester = Sys.ActorOf(Props.Create(() => new SequenceVerifier(here, TestActor)));
196203
tester.Tell("start");

0 commit comments

Comments
 (0)