Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ClusterLogSpec, EventFilter does not play nice with Within #6041

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 13 additions & 19 deletions src/core/Akka.Cluster.Tests/ClusterLogSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,17 @@ protected async Task AwaitUpAsync()
/// </summary>
protected async Task JoinAsync(string expected)
{
await WithinAsync(TimeSpan.FromSeconds(10), async () =>
{
await EventFilter
.Info(contains: expected)
.ExpectOneAsync(async () => {
var tcs = new TaskCompletionSource<bool>();
_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<bool>();
_cluster.RegisterOnMemberUp(() =>
{
tcs.TrySetResult(true);
});
});
_cluster.Join(_selfAddress);
await tcs.Task.ShouldCompleteWithin(10.Seconds());
});
}

/// <summary>
Expand All @@ -86,21 +83,18 @@ await EventFilter
/// <param name="expected"></param>
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<bool>();
_cluster.RegisterOnMemberRemoved(() =>
{
tcs.TrySetResult(true);
});
_cluster.Down(_selfAddress);
await tcs.Task.ShouldCompleteWithin(Remaining);
await tcs.Task.ShouldCompleteWithin(10.Seconds());
});
});
}
}

Expand Down