diff --git a/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs b/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs index 0accade3d3f445..164b4b8632a43b 100644 --- a/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs +++ b/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs @@ -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); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs index 1e362a04819c0f..f23a1e835b7be3 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs @@ -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 } @@ -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); @@ -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 @@ -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);