From 3fe10b0cab04aa47131d08889ed256bc60dc328f Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Wed, 4 Jan 2023 22:45:31 +0700 Subject: [PATCH 1/4] Fix transport actor to account all reported status --- .../Transports/LivenessTransportActor.cs | 37 +++++++++++++------ .../Transports/ReadinessTransportActor.cs | 35 +++++++++++++----- .../Sockets/SocketStatusTransport.cs | 29 +++++++++++---- 3 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs b/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs index 20df699..33dd922 100644 --- a/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs +++ b/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs @@ -23,6 +23,7 @@ public sealed class LivenessTransportActor : ReceiveActor { private const int LivenessTimeout = 1000; private readonly List _livenessProbes; + private readonly Dictionary _statuses = new (); private readonly ILoggingAdapter _log = Context.GetLogger(); private readonly IStatusTransport _statusTransport; private readonly bool _logInfo; @@ -31,25 +32,34 @@ public LivenessTransportActor(IStatusTransport statusTransport, ImmutableDiction { _statusTransport = statusTransport; var probeReverseLookup = livenessProbes.ToImmutableDictionary(kvp => kvp.Value, kvp => kvp.Key); + foreach (var kvp in livenessProbes) + { + Context.Watch(kvp.Value); + _statuses[kvp.Key] = new LivenessStatus(false, $"Probe {kvp.Key} starting up."); + } _livenessProbes = livenessProbes.Values.ToList(); _logInfo = log; ReceiveAsync(async status => { var probeName = probeReverseLookup[Sender]; - - if (_logInfo) - _log.Info("Received liveness status from probe [{0}]. Live: {1}, Message: {2}", probeName, - status.IsLive, status.StatusMessage); - - var cts = new CancellationTokenSource(LivenessTimeout); TransportWriteStatus writeStatus; + using var cts = new CancellationTokenSource(LivenessTimeout); try { - if (status.IsLive) - writeStatus = await _statusTransport.Go($"[{probeName}] {status.StatusMessage}", cts.Token); + if (_logInfo) + _log.Info("Received liveness status from probe [{0}]. Live: {1}, Message: {2}", probeName, + status.IsLive, status.StatusMessage); + + _statuses[probeName] = status; + var statusMessage = string.Join( + Environment.NewLine, + _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsLive ? "Live" : "Not Live")}] {status.StatusMessage}")); + + if (_statuses.Values.All(s => s.IsLive)) + writeStatus = await _statusTransport.Go(statusMessage, cts.Token); else - writeStatus = await _statusTransport.Stop($"[{probeName}] {status.StatusMessage}", cts.Token); + writeStatus = await _statusTransport.Stop(statusMessage, cts.Token); } catch (Exception e) { @@ -76,7 +86,13 @@ public LivenessTransportActor(IStatusTransport statusTransport, ImmutableDiction Receive(t => { + var probeName = probeReverseLookup[t.ActorRef]; + if (_logInfo) + _log.Info("Liveness probe {0} terminated", probeName); + + _statuses[probeName] = new LivenessStatus(false, "Probe terminated"); _livenessProbes.Remove(t.ActorRef); + if (_livenessProbes.Count == 0) { _log.Warning("All liveness probe actors terminated! Shutting down."); @@ -96,8 +112,7 @@ protected override void PreStart() protected override void PostStop() { - var cts = new CancellationTokenSource(LivenessTimeout); - + using var cts = new CancellationTokenSource(LivenessTimeout); try { _statusTransport.Stop(null, cts.Token).Wait(cts.Token); diff --git a/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs b/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs index 505b447..f642959 100644 --- a/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs +++ b/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs @@ -24,6 +24,7 @@ public sealed class ReadinessTransportActor : ReceiveActor private const int ReadinessTimeout = 1000; private readonly ILoggingAdapter _log = Context.GetLogger(); private readonly List _readinessProbes; + private readonly Dictionary _statuses = new (); private readonly IStatusTransport _statusTransport; private readonly bool _logInfo; @@ -31,25 +32,34 @@ public ReadinessTransportActor(IStatusTransport statusTransport, ImmutableDictio { _statusTransport = statusTransport; var probeReverseLookup = readinessProbe.ToImmutableDictionary(kvp => kvp.Value, kvp => kvp.Key); + foreach (var kvp in readinessProbe) + { + Context.Watch(kvp.Value); + _statuses[kvp.Key] = new ReadinessStatus(false, $"Probe {kvp.Key} starting up."); + } _readinessProbes = readinessProbe.Values.ToList(); _logInfo = log; ReceiveAsync(async status => { var probeName = probeReverseLookup[Sender]; - - if (_logInfo) - _log.Info("Received readiness status from probe [{0}]. Ready: {1}, Message: {2}", probeName, - status.IsReady, status.StatusMessage); - - var cts = new CancellationTokenSource(ReadinessTimeout); + using var cts = new CancellationTokenSource(ReadinessTimeout); TransportWriteStatus writeStatus; try { - if (status.IsReady) - writeStatus = await _statusTransport.Go($"[{probeName}] {status.StatusMessage}", cts.Token); + if (_logInfo) + _log.Info("Received readiness status from probe [{0}]. Ready: {1}, Message: {2}", probeName, + status.IsReady, status.StatusMessage); + + _statuses[probeName] = status; + var statusMessage = string.Join( + Environment.NewLine, + _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsReady ? "Ready" : "Not Ready")}] {status.StatusMessage}")); + + if (_statuses.Values.All(s => s.IsReady)) + writeStatus = await _statusTransport.Go(statusMessage, cts.Token); else - writeStatus = await _statusTransport.Stop($"[{probeName}] {status.StatusMessage}", cts.Token); + writeStatus = await _statusTransport.Stop(statusMessage, cts.Token); } catch (Exception e) { @@ -76,6 +86,11 @@ public ReadinessTransportActor(IStatusTransport statusTransport, ImmutableDictio Receive(t => { + var probeName = probeReverseLookup[t.ActorRef]; + if (_logInfo) + _log.Info("Readiness probe {0} terminated", probeName); + + _statuses[probeName] = new ReadinessStatus(false, "Probe terminated"); _readinessProbes.Remove(t.ActorRef); if (_readinessProbes.Count == 0) { @@ -96,7 +111,7 @@ protected override void PreStart() protected override void PostStop() { - var cts = new CancellationTokenSource(ReadinessTimeout); + using var cts = new CancellationTokenSource(ReadinessTimeout); try { diff --git a/src/Akka.HealthCheck/Transports/Sockets/SocketStatusTransport.cs b/src/Akka.HealthCheck/Transports/Sockets/SocketStatusTransport.cs index 052cdf4..f1d596e 100644 --- a/src/Akka.HealthCheck/Transports/Sockets/SocketStatusTransport.cs +++ b/src/Akka.HealthCheck/Transports/Sockets/SocketStatusTransport.cs @@ -41,8 +41,8 @@ public Task Go(string? statusMessage, CancellationToken to _socket.Bind(new IPEndPoint(IPAddress.Any, Settings.Port)); _socket.Listen(10); - // want this to run async, without waiting #pragma warning disable CS4014 + // want this to run async, without waiting _socket.AcceptAsync().ContinueWith(HandleAccept, _socket, _abortSocket.Token); #pragma warning restore CS4014 } @@ -61,14 +61,27 @@ private void HandleAccept(Task tr, object? o) throw new Exception("Continuation error, state object is null"); if (o is not Socket parentSocket) - throw new Exception("Continuation error, state object is not of type Socket"); + throw new Exception($"Continuation error, state object is not of type Socket, was: {o.GetType()}"); + + // Not blocking, handler delegate is called when the task completed. + using var connectionSocket = tr.Result; + try + { + System.Diagnostics.Debug.Assert(parentSocket != connectionSocket); + connectionSocket.Send(Msg); + connectionSocket.Shutdown(SocketShutdown.Both); + connectionSocket.Close(); + } + finally + { + connectionSocket.Dispose(); + } - var connectionSocket = tr.Result; - System.Diagnostics.Debug.Assert(parentSocket != connectionSocket); - connectionSocket.Send(Msg); - connectionSocket.Shutdown(SocketShutdown.Both); - connectionSocket.Close(); - parentSocket.AcceptAsync().ContinueWith(HandleAccept, parentSocket, _abortSocket!.Token); + if(_abortSocket is { }) + { + _abortSocket.Token.ThrowIfCancellationRequested(); + parentSocket.AcceptAsync().ContinueWith(HandleAccept, parentSocket, _abortSocket.Token); + } } public Task Stop(string? statusMessage, CancellationToken token) From 7bb5fc8a3d2722fb451ff8e71b6bfacbd1cf8e02 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Jan 2023 00:17:31 +0700 Subject: [PATCH 2/4] Fix terminate check and add unit tests --- .../Liveness/LivenessTransportActorSpecs.cs | 77 ++++++++++++++++++- .../Readiness/ReadinessTransportActorSpecs.cs | 76 +++++++++++++++++- .../Transports/LivenessTransportActor.cs | 10 ++- .../Transports/ReadinessTransportActor.cs | 8 +- 4 files changed, 162 insertions(+), 9 deletions(-) diff --git a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs index 785c575..8d66b77 100644 --- a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs +++ b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Threading.Tasks; using Akka.Actor; using Akka.HealthCheck.Liveness; using Akka.HealthCheck.Tests.Transports; @@ -116,7 +117,7 @@ public void LivenessTransportActor_should_send_Stop_when_terminated() { var testTransport = new TestStatusTransport(new TestStatusTransportSettings(true, true, TimeSpan.Zero)); var fakeLiveness = CreateTestProbe("liveness"); - var dict = new Dictionary { ["default"] = fakeLiveness }.ToImmutableDictionary();; + var dict = new Dictionary { ["default"] = fakeLiveness }.ToImmutableDictionary(); var transportActor = Sys.ActorOf(Props.Create(() => new LivenessTransportActor(testTransport, dict, true))); @@ -129,5 +130,79 @@ public void LivenessTransportActor_should_send_Stop_when_terminated() AwaitCondition(() => testTransport.SystemCalls.Count == 1 && testTransport.SystemCalls[0] == TestStatusTransport.TransportCall.Stop); } + + [Fact(DisplayName = "LivenessTransportActor with multiple probes should report correctly based on probe responses")] + public async Task LivenessTransportActorMultiProbeTest() + { + var testTransport = new TestStatusTransport(new TestStatusTransportSettings(true, true, TimeSpan.Zero)); + var fakeLiveness1 = CreateTestProbe("liveness_1"); + var fakeLiveness2 = CreateTestProbe("liveness_2"); + var dict = new Dictionary + { + ["first"] = fakeLiveness1, + ["second"] = fakeLiveness2 + }.ToImmutableDictionary(); + + var transportActor = + Sys.ActorOf(Props.Create(() => new LivenessTransportActor(testTransport, dict, true))); + + fakeLiveness1.ExpectMsg(); + fakeLiveness2.ExpectMsg(); + + // "second" status should still be false because it has not reported in yet + transportActor.Tell(new LivenessStatus(true), fakeLiveness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 1 + && testTransport.SystemCalls[0] == TestStatusTransport.TransportCall.Stop); + + // both probe status is true, Go should be called + transportActor.Tell(new LivenessStatus(true), fakeLiveness2); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 2 + && testTransport.SystemCalls[1] == TestStatusTransport.TransportCall.Go); + + // probes reported true, Go should be called all the time + foreach (var i in Enumerable.Range(2, 8)) + { + transportActor.Tell(new LivenessStatus(true), i % 2 == 0 ? fakeLiveness1 : fakeLiveness2); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == i + 1 + && testTransport.SystemCalls[i] == TestStatusTransport.TransportCall.Go); + } + + // Stop should be called as soon as one of the probe failed + transportActor.Tell(new LivenessStatus(false), fakeLiveness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 11 + && testTransport.SystemCalls[10] == TestStatusTransport.TransportCall.Stop); + + // Go should be called again as soon as the failing probe reports true + transportActor.Tell(new LivenessStatus(true), fakeLiveness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 12 + && testTransport.SystemCalls[11] == TestStatusTransport.TransportCall.Go); + + // Stop should be called when a probe died + Watch(fakeLiveness1); + fakeLiveness1.Tell(PoisonPill.Instance); + ExpectTerminated(fakeLiveness1); + Unwatch(fakeLiveness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 13 + && testTransport.SystemCalls[12] == TestStatusTransport.TransportCall.Stop); + + // transport actor should stop when all probe died + Watch(fakeLiveness2); + Watch(transportActor); + fakeLiveness2.Tell(PoisonPill.Instance); + ExpectTerminated(fakeLiveness2); + ExpectTerminated(transportActor); + + // Last Stop call from PostStop + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 15 + && testTransport.SystemCalls[14] == TestStatusTransport.TransportCall.Stop); + } + } } \ No newline at end of file diff --git a/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs b/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs index 519ae34..39626cd 100644 --- a/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs +++ b/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Collections.Generic; using System.Collections.Immutable; +using System.Threading.Tasks; using Akka.Actor; using Akka.HealthCheck.Readiness; using Akka.HealthCheck.Tests.Transports; @@ -116,7 +117,7 @@ public void ReadinessTransportActor_should_send_Stop_when_terminated() { var testTransport = new TestStatusTransport(new TestStatusTransportSettings(true, true, TimeSpan.Zero)); var fakeReadiness = CreateTestProbe("readiness"); - var dict = new Dictionary { ["default"] = fakeReadiness }.ToImmutableDictionary();; + var dict = new Dictionary { ["default"] = fakeReadiness }.ToImmutableDictionary(); var transportActor = Sys.ActorOf(Props.Create(() => new ReadinessTransportActor(testTransport, dict, true))); @@ -129,5 +130,78 @@ public void ReadinessTransportActor_should_send_Stop_when_terminated() AwaitCondition(() => testTransport.SystemCalls.Count == 1 && testTransport.SystemCalls[0] == TestStatusTransport.TransportCall.Stop); } + + [Fact(DisplayName = "ReadinessTransportActor with multiple probes should report correctly based on probe responses")] + public async Task ReadinessTransportActorMultiProbeTest() + { + var testTransport = new TestStatusTransport(new TestStatusTransportSettings(true, true, TimeSpan.Zero)); + var fakeReadiness1 = CreateTestProbe("readiness_1"); + var fakeReadiness2 = CreateTestProbe("readiness_2"); + var dict = new Dictionary + { + ["first"] = fakeReadiness1, + ["second"] = fakeReadiness2 + }.ToImmutableDictionary(); + + var transportActor = + Sys.ActorOf(Props.Create(() => new ReadinessTransportActor(testTransport, dict, true))); + + fakeReadiness1.ExpectMsg(); + fakeReadiness2.ExpectMsg(); + + // "second" status should still be false because it has not reported in yet + transportActor.Tell(new ReadinessStatus(true), fakeReadiness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 1 + && testTransport.SystemCalls[0] == TestStatusTransport.TransportCall.Stop); + + // both probe status is true, Go should be called + transportActor.Tell(new ReadinessStatus(true), fakeReadiness2); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 2 + && testTransport.SystemCalls[1] == TestStatusTransport.TransportCall.Go); + + // probes reported true, Go should be called all the time + foreach (var i in Enumerable.Range(2, 8)) + { + transportActor.Tell(new ReadinessStatus(true), i % 2 == 0 ? fakeReadiness1 : fakeReadiness2); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == i + 1 + && testTransport.SystemCalls[i] == TestStatusTransport.TransportCall.Go); + } + + // Stop should be called as soon as one of the probe failed + transportActor.Tell(new ReadinessStatus(false), fakeReadiness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 11 + && testTransport.SystemCalls[10] == TestStatusTransport.TransportCall.Stop); + + // Go should be called again as soon as the failing probe reports true + transportActor.Tell(new ReadinessStatus(true), fakeReadiness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 12 + && testTransport.SystemCalls[11] == TestStatusTransport.TransportCall.Go); + + // Stop should be called when a probe died + Watch(fakeReadiness1); + fakeReadiness1.Tell(PoisonPill.Instance); + ExpectTerminated(fakeReadiness1); + Unwatch(fakeReadiness1); + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 13 + && testTransport.SystemCalls[12] == TestStatusTransport.TransportCall.Stop); + + // transport actor should stop when all probe died + Watch(fakeReadiness2); + Watch(transportActor); + fakeReadiness2.Tell(PoisonPill.Instance); + ExpectTerminated(fakeReadiness2); + ExpectTerminated(transportActor); + + // Last Stop call from PostStop + await AwaitConditionAsync(() => + testTransport.SystemCalls.Count == 15 + && testTransport.SystemCalls[14] == TestStatusTransport.TransportCall.Stop); + } } } \ No newline at end of file diff --git a/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs b/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs index 33dd922..ff02bb1 100644 --- a/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs +++ b/src/Akka.HealthCheck/Transports/LivenessTransportActor.cs @@ -43,8 +43,8 @@ public LivenessTransportActor(IStatusTransport statusTransport, ImmutableDiction ReceiveAsync(async status => { var probeName = probeReverseLookup[Sender]; - TransportWriteStatus writeStatus; using var cts = new CancellationTokenSource(LivenessTimeout); + TransportWriteStatus writeStatus; try { if (_logInfo) @@ -54,7 +54,7 @@ public LivenessTransportActor(IStatusTransport statusTransport, ImmutableDiction _statuses[probeName] = status; var statusMessage = string.Join( Environment.NewLine, - _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsLive ? "Live" : "Not Live")}] {status.StatusMessage}")); + _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsLive ? "Live" : "Not Live")}] {kvp.Value.StatusMessage}")); if (_statuses.Values.All(s => s.IsLive)) writeStatus = await _statusTransport.Go(statusMessage, cts.Token); @@ -90,14 +90,16 @@ public LivenessTransportActor(IStatusTransport statusTransport, ImmutableDiction if (_logInfo) _log.Info("Liveness probe {0} terminated", probeName); - _statuses[probeName] = new LivenessStatus(false, "Probe terminated"); _livenessProbes.Remove(t.ActorRef); - if (_livenessProbes.Count == 0) { _log.Warning("All liveness probe actors terminated! Shutting down."); Context.Stop(Self); } + else + { + Self.Tell(new LivenessStatus(false, "Probe terminated"), t.ActorRef); + } }); } diff --git a/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs b/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs index f642959..594c89e 100644 --- a/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs +++ b/src/Akka.HealthCheck/Transports/ReadinessTransportActor.cs @@ -54,7 +54,7 @@ public ReadinessTransportActor(IStatusTransport statusTransport, ImmutableDictio _statuses[probeName] = status; var statusMessage = string.Join( Environment.NewLine, - _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsReady ? "Ready" : "Not Ready")}] {status.StatusMessage}")); + _statuses.Select(kvp => $"[{kvp.Key}][{(kvp.Value.IsReady ? "Ready" : "Not Ready")}] {kvp.Value.StatusMessage}")); if (_statuses.Values.All(s => s.IsReady)) writeStatus = await _statusTransport.Go(statusMessage, cts.Token); @@ -90,13 +90,16 @@ public ReadinessTransportActor(IStatusTransport statusTransport, ImmutableDictio if (_logInfo) _log.Info("Readiness probe {0} terminated", probeName); - _statuses[probeName] = new ReadinessStatus(false, "Probe terminated"); _readinessProbes.Remove(t.ActorRef); if (_readinessProbes.Count == 0) { _log.Warning("All readiness probe actors terminated! Shutting down."); Context.Stop(Self); } + else + { + Self.Tell(new ReadinessStatus(false, "Probe terminated"), t.ActorRef); + } }); } @@ -112,7 +115,6 @@ protected override void PreStart() protected override void PostStop() { using var cts = new CancellationTokenSource(ReadinessTimeout); - try { _statusTransport.Stop(null, cts.Token).Wait(cts.Token); From 743db809fda9073eed4e0aca8f93f14667908eaf Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Wed, 4 Jan 2023 11:36:56 -0600 Subject: [PATCH 3/4] fix whitespace --- .../Liveness/LivenessTransportActorSpecs.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs index 8d66b77..f3743da 100644 --- a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs +++ b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs @@ -64,7 +64,6 @@ public void LivenessTransportActor_should_crash_when_Stop_or_Go_failure() }); } - [Fact(DisplayName = "LivenessTransportActor should crash and try to stop signal upon timeout during signal change")] public void LivenessTransportActor_should_crash_when_Timedout() From 3f9eecaeff9ae8475525a819678f596efa87aa84 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 5 Jan 2023 00:44:50 +0700 Subject: [PATCH 4/4] Fix off by one bug --- .../Liveness/LivenessTransportActorSpecs.cs | 4 ++-- .../Readiness/ReadinessTransportActorSpecs.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs index f3743da..074f75c 100644 --- a/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs +++ b/src/Akka.HealthCheck.Tests/Liveness/LivenessTransportActorSpecs.cs @@ -199,8 +199,8 @@ await AwaitConditionAsync(() => // Last Stop call from PostStop await AwaitConditionAsync(() => - testTransport.SystemCalls.Count == 15 - && testTransport.SystemCalls[14] == TestStatusTransport.TransportCall.Stop); + testTransport.SystemCalls.Count == 14 + && testTransport.SystemCalls[13] == TestStatusTransport.TransportCall.Stop); } } diff --git a/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs b/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs index 39626cd..f635466 100644 --- a/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs +++ b/src/Akka.HealthCheck.Tests/Readiness/ReadinessTransportActorSpecs.cs @@ -200,8 +200,8 @@ await AwaitConditionAsync(() => // Last Stop call from PostStop await AwaitConditionAsync(() => - testTransport.SystemCalls.Count == 15 - && testTransport.SystemCalls[14] == TestStatusTransport.TransportCall.Stop); + testTransport.SystemCalls.Count == 14 + && testTransport.SystemCalls[13] == TestStatusTransport.TransportCall.Stop); } } } \ No newline at end of file