Skip to content

[macOS] Fix flaky GeolocationProviderTests on CI#4478

Open
mallexxx wants to merge 2 commits intomainfrom
alex/geolocation-provider-tests-flakiness
Open

[macOS] Fix flaky GeolocationProviderTests on CI#4478
mallexxx wants to merge 2 commits intomainfrom
alex/geolocation-provider-tests-flakiness

Conversation

@mallexxx
Copy link
Copy Markdown
Contributor

@mallexxx mallexxx commented Apr 20, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1201037661562251/task/1213996660793764
Tech Design URL: N/A
CC: N/A

Description

  • Increase waitForExpectations(timeout:) from 10s to 30s in the two dual-webview geolocation tests that each spin up two separate WKProcessPool instances (and thus two WebContent processes)

Testing Steps

  • Run GeolocationProviderTests in Xcode to verify all 16 tests pass

Impact and Risks

Impact Level: None

What could go wrong?

  • No functional risk — only test timeout thresholds are changed; production code is untouched

Quality Considerations

The two affected tests (testWhenMultipleWebViewsRequestLocationThenItIsSubscribedAndCancelledCorrectly and testWhenOneWebViewGeolocationIsPausedThenAnotherWebViewContinuesReceivingLocationUpdates) each create two WKWebViews with independent WKProcessPool instances, 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-WKWebView geolocation unit tests (testWhenMultipleWebViewsRequestLocationThenItIsSubscribedAndCancelledCorrectly and testWhenOneWebViewGeolocationIsPausedThenAnotherWebViewContinuesReceivingLocationUpdates) 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.

@mallexxx mallexxx requested a review from edulpn April 20, 2026 06:47
mallexxx and others added 2 commits April 20, 2026 12:56
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>
@mallexxx mallexxx force-pushed the alex/geolocation-provider-tests-flakiness branch from 1f62362 to e492aed Compare April 20, 2026 06:57
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.

1 participant