diff --git a/src/core/Akka.Cluster.Tests/ClusterLogSpec.cs b/src/core/Akka.Cluster.Tests/ClusterLogSpec.cs index a2593514f11..28bee055f3d 100644 --- a/src/core/Akka.Cluster.Tests/ClusterLogSpec.cs +++ b/src/core/Akka.Cluster.Tests/ClusterLogSpec.cs @@ -64,20 +64,17 @@ await WithinAsync(TimeSpan.FromSeconds(10), async() => /// protected async Task JoinAsync(string expected) { - await WithinAsync(TimeSpan.FromSeconds(10), async () => - { - await EventFilter - .Info(contains: expected) - .ExpectOneAsync(async () => { - var tcs = new TaskCompletionSource(); - _cluster.RegisterOnMemberUp(() => - { - tcs.TrySetResult(true); - }); - _cluster.Join(_selfAddress); - await tcs.Task.ShouldCompleteWithin(Remaining); + await EventFilter + .Info(contains: expected) + .ExpectOneAsync(10.Seconds(), async () => { + var tcs = new TaskCompletionSource(); + _cluster.RegisterOnMemberUp(() => + { + tcs.TrySetResult(true); }); - }); + _cluster.Join(_selfAddress); + await tcs.Task.ShouldCompleteWithin(10.Seconds()); + }); } /// @@ -86,11 +83,9 @@ await EventFilter /// protected async Task DownAsync(string expected) { - await WithinAsync(TimeSpan.FromSeconds(10), async () => - { - await EventFilter + await EventFilter .Info(contains: expected) - .ExpectOneAsync(async () => + .ExpectOneAsync(10.Seconds(), async () => { var tcs = new TaskCompletionSource(); _cluster.RegisterOnMemberRemoved(() => @@ -98,9 +93,8 @@ await EventFilter tcs.TrySetResult(true); }); _cluster.Down(_selfAddress); - await tcs.Task.ShouldCompleteWithin(Remaining); + await tcs.Task.ShouldCompleteWithin(10.Seconds()); }); - }); } } @@ -131,9 +125,9 @@ public ClusterLogVerboseDefaultSpec(ITestOutputHelper output) public async Task A_cluster_must_not_log_verbose_cluster_events_by_default() { _cluster.Settings.LogInfoVerbose.ShouldBeFalse(); - await JoinAsync(upLogMessage).ShouldThrowWithin(10.Seconds()); + await JoinAsync(upLogMessage).ShouldThrowWithin(11.Seconds()); await AwaitUpAsync(); - await DownAsync(downLogMessage).ShouldThrowWithin(10.Seconds()); + await DownAsync(downLogMessage).ShouldThrowWithin(11.Seconds()); } }