diff --git a/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.EasyRequest.cs b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.EasyRequest.cs index 47996113d11d..d8b2d73efaa8 100644 --- a/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.EasyRequest.cs +++ b/src/System.Net.Http/src/System/Net/Http/CurlHandler/CurlHandler.EasyRequest.cs @@ -311,8 +311,8 @@ private void SetMultithreading() private void SetTimeouts() { - // Set timeout limit on the connect phase. - SetCurlOption(CURLoption.CURLOPT_CONNECTTIMEOUT_MS, int.MaxValue); + // Set timeout limit on the connect phase. curl has bug on ARM so use max - 1s. + SetCurlOption(CURLoption.CURLOPT_CONNECTTIMEOUT_MS, int.MaxValue - 1000); // Override the default DNS cache timeout. libcurl defaults to a 1 minute // timeout, but we extend that to match the Windows timeout of 10 minutes. diff --git a/src/System.Net.Http/tests/FunctionalTests/NtAuthTests.cs b/src/System.Net.Http/tests/FunctionalTests/NtAuthTests.cs index 6110c423ef93..94d587514e8b 100644 --- a/src/System.Net.Http/tests/FunctionalTests/NtAuthTests.cs +++ b/src/System.Net.Http/tests/FunctionalTests/NtAuthTests.cs @@ -48,13 +48,21 @@ public NtAuthServer(AuthenticationSchemes authSchemes) { // Ignore. } + catch (ObjectDisposedException) + { + // Ignore. + } + catch (InvalidOperationException) + { + // Ignore. + } }); } public void Dispose() { _listener.Stop(); - _serverTask.Wait(); + _serverTask.Wait(TestHelper.PassingTestTimeoutMilliseconds); } public string BaseUrl { get; private set; } diff --git a/src/System.Net.Http/tests/FunctionalTests/TestHelper.cs b/src/System.Net.Http/tests/FunctionalTests/TestHelper.cs index 22b267fb413b..ed800d2fd8a2 100644 --- a/src/System.Net.Http/tests/FunctionalTests/TestHelper.cs +++ b/src/System.Net.Http/tests/FunctionalTests/TestHelper.cs @@ -93,7 +93,7 @@ public static byte[] ComputeMD5Hash(byte[] data) public static Task WhenAllCompletedOrAnyFailed(params Task[] tasks) { - return TaskTimeoutExtensions.WhenAllOrAnyFailed(tasks); + return TaskTimeoutExtensions.WhenAllOrAnyFailed(tasks, PlatformDetection.IsArmProcess || PlatformDetection.IsArm64Process ? PassingTestTimeoutMilliseconds * 5 : PassingTestTimeoutMilliseconds); } public static Task WhenAllCompletedOrAnyFailedWithTimeout(int timeoutInMilliseconds, params Task[] tasks)