Skip to content

Commit a92e3fd

Browse files
[release/6.0] Increase some of the DnsEndPointTest timeouts (#58617)
* Increase some of the DnsEndPointTest timeouts * remove accidental comment * PassingTestTimeout -> PassingTestShortTimeout & PassingTestLongTimeout * undo renaming PassingTestTimeout * remove whitespaces VS inserted * whitespaces * whitespaces Co-authored-by: Anton Firszov <[email protected]>
1 parent c975e87 commit a92e3fd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace System.Net.Sockets.Tests
88
public static class TestSettings
99
{
1010
// Timeout values in milliseconds.
11-
public const int PassingTestTimeout = 10000;
11+
public const int PassingTestTimeout = 10_000;
12+
public const int PassingTestLongTimeout = 30_000;
1213
public const int FailingTestTimeout = 100;
1314

1415
public static Task WhenAllOrAnyFailedWithTimeout(params Task[] tasks) => tasks.WhenAllOrAnyFailed(PassingTestTimeout);

src/libraries/System.Net.Sockets/tests/FunctionalTests/DnsEndPointTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public void Socket_ConnectAsyncDnsEndPoint_HostNotFound()
272272
bool willRaiseEvent = sock.ConnectAsync(args);
273273
if (willRaiseEvent)
274274
{
275-
Assert.True(complete.WaitOne(TestSettings.PassingTestTimeout), "Timed out while waiting for connection");
275+
Assert.True(complete.WaitOne(TestSettings.PassingTestLongTimeout), "Timed out while waiting for connection");
276276
complete.Dispose(); // only dispose on success as we know we're done with the instance
277277
}
278278

@@ -332,7 +332,7 @@ public void Socket_StaticConnectAsync_Success(SocketImplementationType type)
332332

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

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

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

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

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

410410
AssertHostNotFoundOrNoData(args);

0 commit comments

Comments
 (0)