Skip to content

[macOS Debug] TestWebKitAPI.WKBackForwardList.BackForwardNavigationSkipsItemsWithoutUserGestureFragment is a flaky timeout#64603

Open
cdumez wants to merge 1 commit intoWebKit:mainfrom
cdumez:313844_flaky_test
Open

[macOS Debug] TestWebKitAPI.WKBackForwardList.BackForwardNavigationSkipsItemsWithoutUserGestureFragment is a flaky timeout#64603
cdumez wants to merge 1 commit intoWebKit:mainfrom
cdumez:313844_flaky_test

Conversation

@cdumez
Copy link
Copy Markdown
Contributor

@cdumez cdumez commented May 9, 2026

6a8a875

[macOS Debug] TestWebKitAPI.WKBackForwardList.BackForwardNavigationSkipsItemsWithoutUserGestureFragment is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=313844
rdar://176046782

Reviewed by NOBODY (OOPS!).

The test was disabled on macOS due to flaky timeouts on Intel Debug builds. The
delegate's waitForDidFinishNavigationOrDidSameDocumentNavigation only wakes on
didFinishNavigation or SessionStatePush/SessionStatePop, so for a fragment
navigation via `location.href = '#X'` the sole wake-up signal is the
SessionStatePop IPC fired from FrameLoader::loadInSameDocument. If anything
upstream causes that path to be skipped (for example, Navigation API's
innerDispatchNavigateEvent returning DispatchResult::Aborted due to a race with
a previous fragment nav's queued navigatesuccess task), no signal ever fires
and the wait hangs until the test framework timeout.

Synchronize on the JS completion handler instead. Same-document navigations
triggered by the script (location.href / pushState) are processed by the
WebProcess synchronously, and IPCs to the UIProcess are delivered in order:
the SessionStatePush/Pop IPC is sent before the RunJavaScript reply. By the
time the completion handler fires, the delegate has already run and
lastNavigation has been updated, so the subsequent delegate-based wait is
redundant and removed. The worst-case failure mode becomes a fast assertion
failure with a useful diff rather than a silent timeout.

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKBackForwardListTests.mm:
(runBackForwardNavigationSkipsItemsWithoutUserGestureTest):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGesturePushState)):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGestureFragment)):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGesturePushStateAfterEvaluateJS)):

6a8a875

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ❌ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…ipsItemsWithoutUserGestureFragment is a flaky timeout

https://bugs.webkit.org/show_bug.cgi?id=313844
rdar://176046782

Reviewed by NOBODY (OOPS!).

The test was disabled on macOS due to flaky timeouts on Intel Debug builds. The
delegate's waitForDidFinishNavigationOrDidSameDocumentNavigation only wakes on
didFinishNavigation or SessionStatePush/SessionStatePop, so for a fragment
navigation via `location.href = '#X'` the sole wake-up signal is the
SessionStatePop IPC fired from FrameLoader::loadInSameDocument. If anything
upstream causes that path to be skipped (for example, Navigation API's
innerDispatchNavigateEvent returning DispatchResult::Aborted due to a race with
a previous fragment nav's queued navigatesuccess task), no signal ever fires
and the wait hangs until the test framework timeout.

Synchronize on the JS completion handler instead. Same-document navigations
triggered by the script (location.href / pushState) are processed by the
WebProcess synchronously, and IPCs to the UIProcess are delivered in order:
the SessionStatePush/Pop IPC is sent before the RunJavaScript reply. By the
time the completion handler fires, the delegate has already run and
lastNavigation has been updated, so the subsequent delegate-based wait is
redundant and removed. The worst-case failure mode becomes a fast assertion
failure with a useful diff rather than a silent timeout.

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKBackForwardListTests.mm:
(runBackForwardNavigationSkipsItemsWithoutUserGestureTest):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGesturePushState)):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGestureFragment)):
(TEST(WKBackForwardList, BackForwardNavigationSkipsItemsWithoutUserGesturePushStateAfterEvaluateJS)):
@cdumez cdumez requested a review from rr-codes as a code owner May 9, 2026 08:10
@cdumez cdumez self-assigned this May 9, 2026
@cdumez cdumez added the Page Loading For bugs in page loading, including handling of network callbacks. label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Page Loading For bugs in page loading, including handling of network callbacks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants