From 121ed9393ad8aa8f84e6db48e56fb2d6e9276903 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 12 Feb 2019 13:48:34 +0100 Subject: [PATCH] [Tests] Do not fail with timeouts. Fixes #1332 The bots sometimes have issues with the network. We do not want red builds due to a problem in the connection. Lets set the test to inclonclusive since we cannot assert the headers that have been sent. Fixes https://github.com/xamarin/maccore/issues/1332 --- .../monotouch-test/System.Net.Http/MessageHandlers.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs index 7ed67ee7bfa0..f6ad21c771eb 100644 --- a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs +++ b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs @@ -149,10 +149,13 @@ public void RedirectionWithAuthorizationHeaders (Type handlerType) } }, () => done); - Assert.IsTrue (done, "Request timedout."); - Assert.IsTrue (containsHeaders, "Request did not reach final destination."); - Assert.IsFalse (containsAuthorizarion, $"Authorization header did reach the final destination. {json}"); - Assert.IsNull (ex, $"Exception {ex} for {json}"); + if (!done) { // timeouts happen in the bost due to dns issues, connection issues etc.. we do not want to fail + Assert.Inconclusive ("Request timedout."); + } else { + Assert.IsTrue (containsHeaders, "Request did not reach final destination."); + Assert.IsFalse (containsAuthorizarion, $"Authorization header did reach the final destination. {json}"); + Assert.IsNull (ex, $"Exception {ex} for {json}"); + } } } }