diff --git a/src/core/Akka.Cluster.Tests/ClusterSpec.cs b/src/core/Akka.Cluster.Tests/ClusterSpec.cs index 65d9f419074..9c735833c41 100644 --- a/src/core/Akka.Cluster.Tests/ClusterSpec.cs +++ b/src/core/Akka.Cluster.Tests/ClusterSpec.cs @@ -270,11 +270,11 @@ await WithinAsync(TimeSpan.FromSeconds(10), async () => LeaderActions(); // Exiting --> Removed // Member should leave even a task was cancelled - ExpectMsg().Member.Address.Should().Be(_selfAddress); + (await ExpectMsgAsync()).Member.Address.Should().Be(_selfAddress); // Second task should complete (not cancelled) await AwaitConditionAsync(() => Task.FromResult(task2.IsCompleted && !task2.IsCanceled), null, "Task should be completed, but not cancelled."); - }, cancellationToken: cts.Token); + }); // Subsequent LeaveAsync() tasks expected to complete immediately (not cancelled) var task3 = _cluster.LeaveAsync(); @@ -313,7 +313,7 @@ await AwaitAssertAsync(() => } finally { - Shutdown(sys2); + await ShutdownAsync(sys2); } } @@ -374,7 +374,7 @@ await Awaiting(async () => } finally { - Shutdown(sys); + await ShutdownAsync(sys); } } @@ -435,7 +435,7 @@ await Awaiting(async () => } finally { - Shutdown(sys); + await ShutdownAsync(sys); } } @@ -481,7 +481,7 @@ public async Task A_cluster_must_leave_via_CoordinatedShutdownRun() } finally { - Shutdown(sys2); + await ShutdownAsync(sys2); } } @@ -518,7 +518,7 @@ public async Task A_cluster_must_leave_via_CoordinatedShutdownRun_when_member_st } finally { - Shutdown(sys2); + await ShutdownAsync(sys2); } } @@ -552,7 +552,7 @@ public async Task A_cluster_must_terminate_ActorSystem_via_leave_CoordinatedShut } finally { - Shutdown(sys2); + await ShutdownAsync(sys2); } } @@ -585,7 +585,7 @@ public async Task A_cluster_must_terminate_ActorSystem_via_Down_CoordinatedShutd } finally { - Shutdown(sys3); + await ShutdownAsync(sys3); } } }