Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/core/Akka.Cluster.Tests/ClusterLogSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ protected ClusterLogSpec(ITestOutputHelper output, Config config = null)
_cluster = Cluster.Get(Sys);
}

protected void AwaitUp()
protected async Task AwaitUpAsync()
{
Within(TimeSpan.FromSeconds(10), () =>
await WithinAsync(TimeSpan.FromSeconds(10), async() =>
{
AwaitCondition(() => ClusterView.IsSingletonCluster);
await AwaitConditionAsync(() => ClusterView.IsSingletonCluster);
ClusterView.Self.Address.ShouldBe(_selfAddress);
ClusterView.Members.Select(m => m.Address).ShouldBe(new Address[] { _selfAddress });
AwaitAssert(() => ClusterView.Status.ShouldBe(MemberStatus.Up));
await AwaitAssertAsync(() => ClusterView.Status.ShouldBe(MemberStatus.Up));
});
}


/// <summary>
/// The expected log info pattern to intercept after a <see cref="Cluster.Join(Address)"/>.
/// </summary>
Expand Down Expand Up @@ -122,7 +124,7 @@ public async Task A_cluster_must_log_a_message_when_becoming_and_stopping_being_
_cluster.Settings.LogInfo.ShouldBeTrue();
_cluster.Settings.LogInfoVerbose.ShouldBeFalse();
await JoinAsync("is the new leader");
AwaitUp();
await AwaitUpAsync();
await DownAsync("is no longer leader");
}
}
Expand All @@ -134,11 +136,11 @@ public ClusterLogVerboseDefaultSpec(ITestOutputHelper output)
{ }

[Fact]
public void A_cluster_must_not_log_verbose_cluster_events_by_default()
public async Task A_cluster_must_not_log_verbose_cluster_events_by_default()
{
_cluster.Settings.LogInfoVerbose.ShouldBeFalse();
Intercept<TrueException>(() => Join(upLogMessage));
AwaitUp();
await AwaitUpAsync();
Intercept<TrueException>(() => Down(downLogMessage));
}
}
Expand All @@ -156,7 +158,7 @@ public async Task A_cluster_must_log_verbose_cluster_events_when_log_info_verbos
{
_cluster.Settings.LogInfoVerbose.ShouldBeTrue();
await JoinAsync(upLogMessage);
AwaitUp();
await AwaitUpAsync();
await DownAsync(downLogMessage);
}
}
Expand Down