From 26d8c49ada0b800a83db0503775f104744d0b53f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 4 Nov 2024 09:20:59 +0100 Subject: [PATCH] [tests] Improve PasteboardTest.ImagesTest to hopefully work better. Retry the test 10 times if it fails - it uses a shared resource (the pasteboard), so it's possible to run into race conditions if the same test also runs in a different process at the same time. Also remove code that we removed a long time ago, so that the test actually runs: https://github.com/xamarin/xamarin-macios/commit/86ab2bc1d1b6f57f38693ee2990ac61debe722d0 --- tests/monotouch-test/UIKit/PasteboardTest.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/monotouch-test/UIKit/PasteboardTest.cs b/tests/monotouch-test/UIKit/PasteboardTest.cs index 78209a87f968..f9028528fd96 100644 --- a/tests/monotouch-test/UIKit/PasteboardTest.cs +++ b/tests/monotouch-test/UIKit/PasteboardTest.cs @@ -19,6 +19,7 @@ namespace MonoTouchFixtures.UIKit { public class PasteboardTest { [Test] + [Retry (10)] public void ImagesTest () { string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); @@ -29,10 +30,6 @@ public void ImagesTest () if (TestRuntime.CheckXcodeVersion (8, 0)) Assert.True (UIPasteboard.General.HasImages, "HasImages"); - // https://github.com/xamarin/xamarin-macios/issues/6254 - if (TestRuntime.CheckXcodeVersion (11, 0)) - return; - Assert.AreEqual (1, UIPasteboard.General.Images.Length, "a - length"); UIPasteboard.General.Images = new UIImage [] { img, img };