[macOS] Fix flaky GeolocationProviderTests on CI#4478
Open
Conversation
Tests involving two simultaneous webviews sometimes time out on CI because launching separate WebContent processes for each pool can be slow under load. Fix by pre-warming each webview's WebContent process with an about:blank load in makeWebView(), so the process is already running when the test loads the actual page. Also increase the timeout in the two multi-webview tests from 10s to 30s as an additional safety margin. Task/Issue URL: https://app.asana.com/1/137249556945/project/1201037661562251/task/1213996660793764 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
about:blank is handled in-process by WebKit and doesn't launch a WebContent process, so it provides no pre-warming benefit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1f62362 to
e492aed
Compare
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.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1201037661562251/task/1213996660793764
Tech Design URL: N/A
CC: N/A
Description
waitForExpectations(timeout:)from 10s to 30s in the two dual-webview geolocation tests that each spin up two separateWKProcessPoolinstances (and thus two WebContent processes)Testing Steps
GeolocationProviderTestsin Xcode to verify all 16 tests passImpact and Risks
Impact Level: None
What could go wrong?
Quality Considerations
The two affected tests (
testWhenMultipleWebViewsRequestLocationThenItIsSubscribedAndCancelledCorrectlyandtestWhenOneWebViewGeolocationIsPausedThenAnotherWebViewContinuesReceivingLocationUpdates) each create twoWKWebViews with independentWKProcessPoolinstances, requiring two separate WebContent process launches. On loaded CI runners (macos-26), this can exceed the previous 10s budget. Tests normally complete in ~0.1s; 30s gives ample headroom without masking genuine hangs.Notes to Reviewer
Root cause confirmed via CI log: the test timed out at exactly 10s with only one of the two WebContent processes having finished launching (history showed only one webview subscribed instead of both).
Note
Low Risk
Low risk because only unit-test timeouts are adjusted; the main downside is slightly longer waits before failing if these tests hang.
Overview
Increases the
waitForExpectations(timeout:)from 10s to 30s in two dual-WKWebViewgeolocation unit tests (testWhenMultipleWebViewsRequestLocationThenItIsSubscribedAndCancelledCorrectlyandtestWhenOneWebViewGeolocationIsPausedThenAnotherWebViewContinuesReceivingLocationUpdates) to avoid CI timeouts when launching multiple WebContent processes.No production code changes; this only relaxes test timing thresholds.
Reviewed by Cursor Bugbot for commit e492aed. Bugbot is set up for automated code reviews on this repo. Configure here.