From e23f9df4f3ac9f2a84fa92cdc7980a9810814ea5 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 8 May 2025 08:33:45 +0200 Subject: [PATCH] [tests] Ignore timeouts setting up ProxyTest in CI. Fixes @xamarin/maccore#2691. Fixes the test failing randomly like this: MonoTouchFixtures.CoreFoundation.ProxyTest [FAIL] Fields : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingAsync : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingAsyncNoProxy : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingScript : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingScriptError : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingScriptNoProxy : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingUrl : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingUrlAsync : OneTimeSetUp: Expected: True But was: False [FAIL] TestPACParsingUrlAsyncNoProxy : OneTimeSetUp: Expected: True But was: False [FAIL] TestPacParsingUrlNoProxy : OneTimeSetUp: Expected: True But was: False MonoTouchFixtures.CoreFoundation.ProxyTest : 15153.1114 ms Fixes https://github.com/xamarin/maccore/issues/2691. --- tests/monotouch-test/CoreFoundation/ProxyTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/monotouch-test/CoreFoundation/ProxyTest.cs b/tests/monotouch-test/CoreFoundation/ProxyTest.cs index 8d40043d0c19..5b497b11217b 100644 --- a/tests/monotouch-test/CoreFoundation/ProxyTest.cs +++ b/tests/monotouch-test/CoreFoundation/ProxyTest.cs @@ -100,7 +100,10 @@ public void Setup () }); listener_thread.IsBackground = true; listener_thread.Start (); - Assert.IsTrue (listening.WaitOne (TimeSpan.FromSeconds (15))); + if (!listening.WaitOne (TimeSpan.FromSeconds (15))) { + TestRuntime.IgnoreInCI ("This fails on CI once in a while, so just ignore those."); + Assert.Fail ("Listener thread didn't finish in 15 seconds."); + } } [OneTimeTearDown]