As of now, pending notifications from the resource load observer are not cleared at the conclusion of tests, which can lead to possible bugs where a pending write unintentionally persists into a subsequent test, leading to unexpected results. This is also a speculative fix for the flakiness in the tests here: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2FwebAPIStatistics%2Fnavigator-functions-accessed-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Fcanvas-read-and-write-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Ffont-load-data-collection.html%20http%2Ftests%2FwebAPIStatistics%2Fscreen-functions-accessed-data-collection.html Regardless of whether or not the flakiness is fixed by this patch, it would be good for and pending writes to be cleared in when resetting the statistics to a consistent state.
<rdar://problem/44469275>
Created attachment 349808 [details] Patch
Looks good to me. ;)
Comment on attachment 349808 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=349808&action=review > Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:479 > + statisticsStore->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { }); Why does this only clear memory data but not persistent one?
(In reply to Chris Dumez from comment #4) > Comment on attachment 349808 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=349808&action=review > > > Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp:479 > > + statisticsStore->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { }); > > Why does this only clear memory data but not persistent one? It would be nice to clear the persistent storage between tests, but I am currently investigating if there might be any additional race conditions added simply by replacing the call to scheduleClearInMemory() to scheduleClearInMemoryAndPersistent(). Particularly, is it possible right now that the completion handler for scheduleClearInMemoryAndPersistent() could be called before the memory store has been cleared?
Comment on attachment 349808 [details] Patch Attachment 349808 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/9221897 New failing tests: http/tests/misc/resource-timing-resolution.html
Created attachment 349833 [details] Archive of layout-test-results from ews202 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews202 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Created attachment 349837 [details] Patch
Comment on attachment 349837 [details] Patch Clearing flags on attachment: 349837 Committed r236071: <https://trac.webkit.org/changeset/236071>