From 374bf558f78485b0a7a4d16e65579633d5e6f0c5 Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Tue, 4 Aug 2026 15:59:43 +0200 Subject: [PATCH] Stabilize CarouselView leak test cleanup Allow UIKit deferred controller cleanup to complete before forcing managed garbage collection, avoiding false leak failures that race native teardown. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9be49656-7117-4235-9d96-404779ab6b16 --- .../DeviceTests/Elements/CarouselView/CarouselViewTests.iOS.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controls/tests/DeviceTests/Elements/CarouselView/CarouselViewTests.iOS.cs b/src/Controls/tests/DeviceTests/Elements/CarouselView/CarouselViewTests.iOS.cs index 7675d1dd2fc8..10bfc4304586 100644 --- a/src/Controls/tests/DeviceTests/Elements/CarouselView/CarouselViewTests.iOS.cs +++ b/src/Controls/tests/DeviceTests/Elements/CarouselView/CarouselViewTests.iOS.cs @@ -41,6 +41,9 @@ await InvokeOnMainThreadAsync(async () => ((IElementHandler)handler).DisconnectHandler(); }); + // Allow UIKit to release controller-owned references before forcing managed GC. + await Task.Delay(100); + // Force garbage collection await AssertionExtensions.WaitForGC(weakCarouselView, weakHandler);