From 16f126623bf458b482a89074ddcd32d1c96ff921 Mon Sep 17 00:00:00 2001 From: "Eric C. Johnson" Date: Thu, 11 Jun 2026 17:26:43 -0600 Subject: [PATCH 1/4] @W-22954918: [iOS] Stabilize flaky test testBootConfigPickerViewRendered (trivial change to trigger CI) --- .../SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift index 01cf5a894d..6f69dc9eda 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift @@ -79,6 +79,7 @@ class LoginOptionsViewControllerTests: XCTestCase { #endif } + // Flaky test stabilization - W-22954918 func testBootConfigPickerViewRendered() { let expectation = XCTestExpectation(description: "View works with existing BootConfig") From 741f4bccd63dd1d9396b4ad2daf777587b1b6266 Mon Sep 17 00:00:00 2001 From: "Eric C. Johnson" Date: Thu, 11 Jun 2026 17:53:16 -0600 Subject: [PATCH 2/4] @W-22954918: [iOS] Stabilize flaky test testBootConfigPickerViewRendered (remove hardcoded delay) --- .../LoginOptionsViewControllerTests.swift | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift index 6f69dc9eda..38a33a51bd 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift @@ -79,10 +79,7 @@ class LoginOptionsViewControllerTests: XCTestCase { #endif } - // Flaky test stabilization - W-22954918 func testBootConfigPickerViewRendered() { - let expectation = XCTestExpectation(description: "View works with existing BootConfig") - // Create a test BootConfig let testConfig: [String: Any] = [ "remoteAccessConsumerKey": "test_boot_config_key", @@ -91,34 +88,28 @@ class LoginOptionsViewControllerTests: XCTestCase { "shouldAuthenticate": true ] SalesforceManager.shared.bootConfig = BootConfig(testConfig) - + let view = LoginOptionsView { // No-op callback } - + let hostingController = UIHostingController(rootView: view) - + // Create a window and add the view controller let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 375, height: 667)) window.rootViewController = hostingController window.makeKeyAndVisible() - - // Trigger view lifecycle (use appearance transition APIs to avoid callback misuse warning) + + // Trigger view lifecycle hostingController.beginAppearanceTransition(true, animated: false) hostingController.endAppearanceTransition() - - DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { - // Verify view rendered with BootConfig - XCTAssertNotNil(hostingController.view) - - // Clean up - window.rootViewController = nil - window.isHidden = true - - expectation.fulfill() - } - - wait(for: [expectation], timeout: 2.0) + + // Verify view rendered with BootConfig + XCTAssertNotNil(hostingController.view) + + // Clean up + window.rootViewController = nil + window.isHidden = true } func testStaticConfigButtonAction() { From 2e8d31b5c65fb6e0fb4136dbb28c236587d9e4fc Mon Sep 17 00:00:00 2001 From: "Eric C. Johnson" Date: Fri, 12 Jun 2026 14:58:25 -0600 Subject: [PATCH 3/4] @W-22954918: [iOS] Strengthen assertion to verify view layout --- .../LoginOptionsViewControllerTests.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift index 38a33a51bd..f775f3faba 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift @@ -104,8 +104,10 @@ class LoginOptionsViewControllerTests: XCTestCase { hostingController.beginAppearanceTransition(true, animated: false) hostingController.endAppearanceTransition() - // Verify view rendered with BootConfig - XCTAssertNotNil(hostingController.view) + // Verify view rendered with non-zero layout + hostingController.view.layoutIfNeeded() + XCTAssertGreaterThan(hostingController.view.subviews.count, 0) + XCTAssertGreaterThan(hostingController.view.frame.height, 0) // Clean up window.rootViewController = nil From a2879ddec2f0a8ae3b268d527d1430109abb73b4 Mon Sep 17 00:00:00 2001 From: "Eric C. Johnson" Date: Fri, 12 Jun 2026 14:59:09 -0600 Subject: [PATCH 4/4] @W-22954918: [iOS] Restore appearance transition comment --- .../LoginOptionsViewControllerTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift index f775f3faba..7ab558344c 100644 --- a/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift +++ b/libs/SalesforceSDKCore/SalesforceSDKCoreTests/LoginOptionsViewControllerTests.swift @@ -100,13 +100,13 @@ class LoginOptionsViewControllerTests: XCTestCase { window.rootViewController = hostingController window.makeKeyAndVisible() - // Trigger view lifecycle + // Trigger view lifecycle (use appearance transition APIs to avoid callback misuse warning) hostingController.beginAppearanceTransition(true, animated: false) hostingController.endAppearanceTransition() - // Verify view rendered with non-zero layout + // Verify view rendered with non-zero layout (frame.height relies only on UIKit layout, + // avoiding SwiftUI internals like subview count which could vary across OS versions) hostingController.view.layoutIfNeeded() - XCTAssertGreaterThan(hostingController.view.subviews.count, 0) XCTAssertGreaterThan(hostingController.view.frame.height, 0) // Clean up