Bug 228571

Summary: [ Mac ] fast/dom/webtiming-document-open.html is a flaky failure
Product: WebKit Reporter: Eric Hutchison <ehutchison>
Component: DOMAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, cdumez, ehutchison, mark.lam, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch cdumez: review+

Description Eric Hutchison 2021-07-28 16:03:08 PDT
fast/dom/webtiming-document-open.html 

is a flaky failure.

History: https://results.webkit.org/?platform=mac&suite=layout-tests&test=fast%2Fdom%2Fwebtiming-document-open.html

Results: https://build.webkit.org/results/Apple-BigSur-Debug-WK2-Tests/r280347%20(2979)/results.html

Diff: 
--- /Volumes/Data/worker/bigsur-debug-tests-wk2/build/layout-test-results/fast/dom/webtiming-document-open-expected.txt
+++ /Volumes/Data/worker/bigsur-debug-tests-wk2/build/layout-test-results/fast/dom/webtiming-document-open-actual.txt
@@ -13,7 +13,7 @@
 PASS timing.domainLookupEnd is originalTiming.domainLookupEnd
 PASS timing.domainLookupStart is originalTiming.domainLookupStart
 PASS timing.fetchStart is originalTiming.fetchStart
-PASS timing.loadEventEnd is originalTiming.loadEventEnd
+FAIL timing.loadEventEnd should be 1627422346940. Was 1627422346941.
 PASS timing.loadEventStart is originalTiming.loadEventStart
 PASS timing.navigationStart is originalTiming.navigationStart
 PASS timing.redirectEnd is originalTiming.redirectEnd

Reproduced on r280380 using run-webkit-tests  -f --iterations 500 --exit-after-n-failures 1 --clobber-old-results fast/dom/webtiming-document-open.html.
Comment 1 Radar WebKit Bug Importer 2021-07-28 16:04:20 PDT
<rdar://problem/81240846>
Comment 2 Eric Hutchison 2021-07-28 16:12:28 PDT
Updated test expectations at https://trac.webkit.org/changeset/280408/webkit.
Comment 3 Alex Christensen 2021-07-29 10:29:53 PDT
Created attachment 434532 [details]
Patch
Comment 4 Chris Dumez 2021-07-29 15:35:03 PDT
Comment on attachment 434532 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434532&action=review

> Source/WebCore/page/PerformanceTiming.cpp:58
>          return 0;

Is it intentional in all these getters that we're not caching in early return cases?

> Source/WebCore/page/PerformanceTiming.cpp:80
> +    m_unloadEventStart =  monotonicTimeToIntegerMilliseconds(timing->unloadEventStart());

nit: extra space
Comment 5 Alex Christensen 2021-07-29 15:57:04 PDT
Comment on attachment 434532 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434532&action=review

>> Source/WebCore/page/PerformanceTiming.cpp:58
>>          return 0;
> 
> Is it intentional in all these getters that we're not caching in early return cases?

All those early returns are unlikely to be hit, and if we do and the website queries multiple times then we'll early return multiple times.
This whole API has been replaced, MDN says it's deprecated and not to use it.  It will be removed a bit after bug 227336 is fixed.
Comment 6 Alex Christensen 2021-07-29 16:02:30 PDT
http://trac.webkit.org/r280454