Bug 251312 - [ iOS BigSur+ ] fast/loader/stateobjects/popstate-does-not-fire-with-page-cache.html is a flaky failure.
Summary: [ iOS BigSur+ ] fast/loader/stateobjects/popstate-does-not-fire-with-page-cac...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-27 22:47 PST by Bri Harris
Modified: 2023-03-16 14:54 PDT (History)
3 users (show)

See Also:


Attachments
text diff (641 bytes, text/plain)
2023-01-27 22:56 PST, Bri Harris
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bri Harris 2023-01-27 22:47:55 PST
fast/loader/stateobjects/popstate-does-not-fire-with-page-cache.html

is a flaky failure on iOS 16, BigSur and later platforms. 

HISTORY:

https://results.webkit.org/?suite=layout-tests&test=fast%2Floader%2Fstateobjects%2Fpopstate-does-not-fire-with-page-cache.html&limit=10000


Crash Log is attached. 

CRASH LOG TEXT:
@@ -10,8 +10,7 @@
 pageshow fired - persisted=false
 PASS testWindowPopstateFireCount is 0
 going back to page 1 in initial state
-popstate fired with state null
-PASS testWindowPopstateFireCount is 1
+FAIL testWindowPopstateFireCount should be 1. Was 0.
 PASS successfullyParsed is true
Comment 1 Radar WebKit Bug Importer 2023-01-27 22:48:17 PST
<rdar://problem/104775065>
Comment 2 Bri Harris 2023-01-27 22:54:49 PST
I was able to reproduce this failure on iOS 16 Release ToT as follows:

run-webkit-test --ios-simulator fast/loader/stateobjects/popstate-does-not-fire-with-page-cache.html --iteration 100

With the iterations, I was able to reproduce 22 failures. 


I was able to reproduce this failure on Ventura Release ToT as follows:

run-webkit-test fast/loader/stateobjects/popstate-does-not-fire-with-page-cache.html --iteration 100

With the iterations, I was able to reproduce 4 failures of 100.
Comment 3 Bri Harris 2023-01-27 22:56:07 PST
Created attachment 464699 [details]
text diff
Comment 4 Bri Harris 2023-01-27 23:06:28 PST
Pull request: https://github.com/WebKit/WebKit/pull/9279
Comment 5 EWS 2023-01-30 08:52:04 PST
Test gardening commit 259561@main (df3d1454d73d): <https://commits.webkit.org/259561@main>

Reviewed commits have been landed. Closing PR #9279 and removing active labels.
Comment 6 Bri Harris 2023-01-30 12:16:03 PST
Pull request: https://github.com/WebKit/WebKit/pull/9334
Comment 7 EWS 2023-01-30 12:25:24 PST
Test gardening commit 259581@main (bda96a710d73): <https://commits.webkit.org/259581@main>

Reviewed commits have been landed. Closing PR #9334 and removing active labels.
Comment 8 Chris Dumez 2023-01-30 15:50:42 PST
Pull request: https://github.com/WebKit/WebKit/pull/9355
Comment 9 EWS 2023-01-31 16:45:21 PST
Committed 259649@main (67c6a041f39c): <https://commits.webkit.org/259649@main>

Reviewed commits have been landed. Closing PR #9355 and removing active labels.
Comment 10 Bri Harris 2023-02-02 12:01:42 PST
Due to test still failing, reopening. Will mark expectations for macOS while this is being investigated.
Comment 11 Bri Harris 2023-02-02 12:15:31 PST
Pull request: https://github.com/WebKit/WebKit/pull/9548
Comment 12 EWS 2023-02-02 12:35:30 PST
Test gardening commit 259774@main (c3714cf7be45): <https://commits.webkit.org/259774@main>

Reviewed commits have been landed. Closing PR #9548 and removing active labels.
Comment 13 Chris Dumez 2023-02-03 16:11:42 PST
This is the part that is flaky:
```
function onTestWindowPageShow(event)
{
    debug("pageshow fired - persisted=" + event.persisted);
    setTimeout(() => {
        // Should not have fired a popstate event since the navigation wasn't within the same document.
        shouldBe("testWindowPopstateFireCount", "0");
        debug('going back to page 1 in initial state');
        setTimeout(function() {testWindow.history.back();}, 0);
    }, 10);
}
```

It seems sometimes `testWindow.history.back()` doesn't cause a back navigation here and the 10ms delay is what makes it flaky. If we don't use a 10ms delay, then it consistently fails.
Comment 14 Chris Dumez 2023-02-03 16:56:59 PST
Pull request: https://github.com/WebKit/WebKit/pull/9637
Comment 15 EWS 2023-02-05 15:03:19 PST
Committed 259873@main (9b11ab322031): <https://commits.webkit.org/259873@main>

Reviewed commits have been landed. Closing PR #9637 and removing active labels.
Comment 16 EWS 2023-03-16 14:54:28 PDT
Committed 259548.431@safari-7615-branch (d4a83e5b2618): <https://commits.webkit.org/259548.431@safari-7615-branch>

Reviewed commits have been landed. Closing PR #468 and removing active labels.