Bug 187710

Summary: Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
Product: WebKit Reporter: John Wilander <wilander>
Component: Tools / TestsAssignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, lforschler, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description John Wilander 2018-07-16 13:09:10 PDT
http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure. Example of a failed run:

/Volumes/Data/slave/highsierra-debug-tests-wk2/build/layout-test-results/http/tests/resourceLoadStatistics/prune-statistics-actual.txt
 1FAIL: Tried to install a second TestRunner callback for the same event (id 13)
 2
13Tests that statistics are pruned in the right order.
24
35On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

68PASS Test iteration 1 passed.
79PASS Test iteration 2 passed.
810PASS Test iteration 3 passed.
 11FAIL checkIfPrevalent: Test iteration 4 failed. http://127.0.0.3:8000/temp was prevalent
 12FAIL checkIfPrevalent: Test iteration 4 failed. http://127.0.0.4:8000/temp was prevalent
 13FAIL checkIfPrevalentAccordingToInitialExpectation: Test iteration 4 failed. http://127.0.0.7:8000/temp wasn't prevalent
 14FAIL checkIfPrevalentAccordingToInitialExpectation: Test iteration 4 failed. http://127.0.0.8:8000/temp wasn't prevalent
915PASS Test iteration 4 passed.
10 PASS Test iteration 5 passed.
11 PASS Test iteration 6 passed.
12 PASS Test iteration 7 passed.
13 PASS Test iteration 8 passed.
1416PASS successfullyParsed is true
 17Some tests failed.
1518
1619TEST COMPLETE
1720
Comment 1 John Wilander 2018-07-16 13:11:55 PDT
<rdar://problem/42252757>
Comment 2 John Wilander 2018-07-16 17:44:14 PDT
Retitling to reflect the changes I'm making to address the flakiness.
Comment 3 John Wilander 2018-07-16 17:54:07 PDT
Created attachment 345132 [details]
Patch
Comment 4 Chris Dumez 2018-07-17 08:46:12 PDT
Comment on attachment 345132 [details]
Patch

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

r=me with nits.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:80
> +    store->setLastSeen(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), Seconds { seconds }, [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:94
> +        store->setPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:112
> +        store->setVeryPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:116
> +        store->clearPrevalentResource(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:182
> +        store->logUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:186
> +        store->clearUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:199
> +    store->logNonRecentUserInteraction(WebCore::URL(WebCore::URL(), WebKit::toImpl(host)->string()), [context, completionHandler]() {

()  not needed.

> Tools/WebKitTestRunner/TestController.cpp:2720
> +    

Bad extra line.
Comment 5 John Wilander 2018-07-17 09:39:30 PDT
Created attachment 345159 [details]
Patch for landing
Comment 6 John Wilander 2018-07-17 09:40:14 PDT
Thanks, Chris!
Comment 7 WebKit Commit Bot 2018-07-17 10:45:49 PDT
Comment on attachment 345159 [details]
Patch for landing

Clearing flags on attachment: 345159

Committed r233888: <https://trac.webkit.org/changeset/233888>
Comment 8 WebKit Commit Bot 2018-07-17 10:45:50 PDT
All reviewed patches have been landed.  Closing bug.