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 racy Akka.Streams.IO.Tcp spec #6430

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
19 changes: 15 additions & 4 deletions src/core/Akka.Streams.Tests/IO/TcpSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,21 @@ public async Task Outgoing_TCP_stream_must_handle_when_connection_actor_terminat
// get initialized, otherwise Kill command may run into the void
await Task.Delay(500);

// Getting rid of existing connection actors by using a blunt instrument
system2.ActorSelection(system2.Tcp().Path / "$a" / "*").Tell(Kill.Instance);

await Awaiting(() => result.ShouldCompleteWithin(3.Seconds()))
await Awaiting(async () =>
{
await WithinAsync(TimeSpan.FromSeconds(15), async () =>
{
await AwaitAssertAsync(async () =>
{
// Getting rid of existing connection actors by using a blunt instrument
system2.ActorSelection(system2.Tcp().Path / "$a" / "*").Tell(Kill.Instance);

await result.ShouldCompleteWithin(3.Seconds());
}, interval:TimeSpan.FromSeconds(4));
});


})
.Should().ThrowAsync<StreamTcpException>();

await binding.Result.Unbind().ShouldCompleteWithin(3.Seconds());
Expand Down