Skip to content

@W-22954918: [iOS] Stabilize flaky test testBootConfigPickerViewRendered#4061

Draft
JohnsonEricAtSalesforce wants to merge 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:feature/W-22954918_stabilize-flaky-test-testbootconfigpickerviewrendered
Draft

@W-22954918: [iOS] Stabilize flaky test testBootConfigPickerViewRendered#4061
JohnsonEricAtSalesforce wants to merge 2 commits into
forcedotcom:devfrom
JohnsonEricAtSalesforce:feature/W-22954918_stabilize-flaky-test-testbootconfigpickerviewrendered

Conversation

@JohnsonEricAtSalesforce

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Stabilizes the flaky testBootConfigPickerViewRendered test by removing a non-deterministic timing pattern.

Root Cause

The test used a hardcoded 200ms DispatchQueue.main.asyncAfter delay with a 2-second XCTestExpectation timeout to wait for a SwiftUI view hierarchy to render. Under CI load, the main run loop can be starved long enough that the asyncAfter block doesn't fire within the timeout window, causing intermittent failures.

Additionally, the assertion (XCTAssertNotNil(hostingController.view)) is trivially true — UIHostingController.view is never nil after initialization — so the async machinery added no testing value.

Fix

Removed the asyncAfter delay, XCTestExpectation, and wait(for:timeout:). The test now asserts synchronously after setting up the view hierarchy and triggering appearance transitions. This makes the test fully deterministic regardless of system load.

Test plan

  • Test passes locally in isolation
  • testBootConfigPickerViewRendered no longer fails in CI
  • No regressions in LoginOptionsViewControllerTests class

This response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce force-pushed the feature/W-22954918_stabilize-flaky-test-testbootconfigpickerviewrendered branch from 9aba348 to 16f1266 Compare June 11, 2026 23:26
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^18 Test Results647 ran645 ✅2 ❌
TestResult
SalesforceSDKCore iOS ^18 Test Results
testNonCallbackURL()❌ failure
SalesforceRestAPITests.testUpdateWithIfUnmodifiedSince❌ failure

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
AuthFlowTester UI Test Results all1 ran1 ✅
TestResult
No test annotations available

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^26 Test Results647 ran646 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^26 Test Results
testAccessToken()❌ failure

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.33%. Comparing base (1c73e4c) to head (741f4bc).
⚠️ Report is 4 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4061      +/-   ##
==========================================
+ Coverage   66.65%   68.33%   +1.67%     
==========================================
  Files         246      246              
  Lines       21481    21481              
==========================================
+ Hits        14318    14678     +360     
+ Misses       7163     6803     -360     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 71.25% <ø> (+0.46%) ⬆️
Core 61.83% <ø> (+2.65%) ⬆️
SmartStore 73.44% <ø> (-0.16%) ⬇️
MobileSync 88.79% <ø> (-0.27%) ⬇️
see 28 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wmathurin wmathurin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks okay. Does it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants