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

Add timeouts to SendRecv_Stream_TCP_MultipleConcurrentReceives #87943

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
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public async Task SendRecv_Stream_TCP_MultipleConcurrentReceives(IPAddress liste
Task clientConnect = ConnectAsync(client, clientEndpoint);
using (Socket remote = await AcceptAsync(server))
{
await clientConnect;
await clientConnect.WaitAsync(TestSettings.PassingTestTimeout);

if (useMultipleBuffers)
{
Expand All @@ -344,7 +344,8 @@ public async Task SendRecv_Stream_TCP_MultipleConcurrentReceives(IPAddress liste

await Task.WhenAll(
SendAsync(remote, new ArraySegment<byte>(new byte[] { 1, 2, 3, 4, 5 })),
receive1, receive2, receive3);
receive1, receive2, receive3)
.WaitAsync(TestSettings.PassingTestTimeout);

Assert.True(receive1.Result == 1 || receive1.Result == 2, $"Expected 1 or 2, got {receive1.Result}");
Assert.True(receive2.Result == 1 || receive2.Result == 2, $"Expected 1 or 2, got {receive2.Result}");
Expand Down Expand Up @@ -398,7 +399,8 @@ await Task.WhenAll(

await Task.WhenAll(
SendAsync(remote, new ArraySegment<byte>(new byte[] { 1, 2, 3 })),
receive1, receive2, receive3);
receive1, receive2, receive3)
.WaitAsync(TestSettings.PassingTestTimeout);

Assert.Equal(3, receive1.Result + receive2.Result + receive3.Result);

Expand Down