Skip to content

Commit

Permalink
Increase some of the DnsEndPointTest timeouts (dotnet#58129)
Browse files Browse the repository at this point in the history
Long story short:
I have spent several hours trying to get a test run on SLES in order to repro dotnet#57929, no success so far, and it may take days to make progress, since I'm unfamiliar with SLES.

I recommend to bump the timeout values for now, and see if it helps with the issue. If not, we may invest into another round of investigation.

(hopefully) fixes dotnet#57929
  • Loading branch information
antonfirsov committed Sep 3, 2021
1 parent 9f6da55 commit 566b3eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace System.Net.Sockets.Tests
public static class TestSettings
{
// Timeout values in milliseconds.
public const int PassingTestTimeout = 10000;
public const int PassingTestTimeout = 10_000;
public const int PassingTestLongTimeout = 30_000;
public const int FailingTestTimeout = 100;

public static Task WhenAllOrAnyFailedWithTimeout(params Task[] tasks) => tasks.WhenAllOrAnyFailed(PassingTestTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void Socket_ConnectAsyncDnsEndPoint_HostNotFound()
bool willRaiseEvent = sock.ConnectAsync(args);
if (willRaiseEvent)
{
Assert.True(complete.WaitOne(TestSettings.PassingTestTimeout), "Timed out while waiting for connection");
Assert.True(complete.WaitOne(TestSettings.PassingTestLongTimeout), "Timed out while waiting for connection");
complete.Dispose(); // only dispose on success as we know we're done with the instance
}

Expand Down Expand Up @@ -332,7 +332,7 @@ public void Socket_StaticConnectAsync_Success(SocketImplementationType type)

if (Socket.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, args))
{
Assert.True(complete.WaitOne(TestSettings.PassingTestTimeout), "Timed out while waiting for connection");
Assert.True(complete.WaitOne(TestSettings.PassingTestLongTimeout), "Timed out while waiting for connection");
}

Assert.Equal(SocketError.Success, args.SocketError);
Expand All @@ -348,7 +348,7 @@ public void Socket_StaticConnectAsync_Success(SocketImplementationType type)

if (Socket.ConnectAsync(SocketType.Stream, ProtocolType.Tcp, args))
{
Assert.True(complete.WaitOne(TestSettings.PassingTestTimeout), "Timed out while waiting for connection");
Assert.True(complete.WaitOne(TestSettings.PassingTestLongTimeout), "Timed out while waiting for connection");
}

complete.Dispose(); // only dispose on success as we know we're done with the instance
Expand Down Expand Up @@ -404,7 +404,7 @@ public void Socket_StaticConnectAsync_HostNotFound()
OnConnectAsyncCompleted(null, args);
}

Assert.True(complete.WaitOne(TestSettings.PassingTestTimeout), "Timed out while waiting for connection");
Assert.True(complete.WaitOne(TestSettings.PassingTestLongTimeout), "Timed out while waiting for connection");
complete.Dispose(); // only dispose on success as we know we're done with the instance

AssertHostNotFoundOrNoData(args);
Expand Down

0 comments on commit 566b3eb

Please sign in to comment.