@W-22954918: [iOS] Stabilize flaky test testBootConfigPickerViewRendered#4061
Draft
JohnsonEricAtSalesforce wants to merge 2 commits into
Conversation
…red (trivial change to trigger CI)
9aba348 to
16f1266
Compare
|
||||||||||||||||||
|
||||||||||||||
|
||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
…red (remove hardcoded delay)
wmathurin
approved these changes
Jun 12, 2026
wmathurin
left a comment
Contributor
There was a problem hiding this comment.
It looks okay. Does it work?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stabilizes the flaky
testBootConfigPickerViewRenderedtest by removing a non-deterministic timing pattern.Root Cause
The test used a hardcoded 200ms
DispatchQueue.main.asyncAfterdelay with a 2-secondXCTestExpectationtimeout to wait for a SwiftUI view hierarchy to render. Under CI load, the main run loop can be starved long enough that theasyncAfterblock doesn't fire within the timeout window, causing intermittent failures.Additionally, the assertion (
XCTAssertNotNil(hostingController.view)) is trivially true —UIHostingController.viewis never nil after initialization — so the async machinery added no testing value.Fix
Removed the
asyncAfterdelay,XCTestExpectation, andwait(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
testBootConfigPickerViewRenderedno longer fails in CILoginOptionsViewControllerTestsclassThis response was generated by an AI agent on behalf of @JohnsonEricAtSalesforce.