Bug 238580 - REGRESSION(r292072): [ Mac iOS ] http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html is a constant text failure
Summary: REGRESSION(r292072): [ Mac iOS ] http/tests/webAPIStatistics/canvas-read-and-...
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
Keywords: InRadar
Depends on:
Reported: 2022-03-30 16:23 PDT by Dawn Morningstar
Modified: 2022-04-01 21:34 PDT (History)
5 users (show)

See Also:

Patch (5.45 KB, patch)
2022-04-01 20:46 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (3.57 KB, patch)
2022-04-01 21:24 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dawn Morningstar 2022-03-30 16:23:31 PDT
Is a flaky text failure on Mac and iOS

Suspected regression point is r292072.
run-webkit-tests http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html --iterations 100
Reveals that this text failure only happens on the first iteration.

Issue does not reproduce at r292069.


--- /Volumes/Data/worker/ios-simulator-15-release-gpuprocess-tests-wk2/build/layout-test-results/http/tests/webAPIStatistics/canvas-read-and-write-data-collection-expected.txt
+++ /Volumes/Data/worker/ios-simulator-15-release-gpuprocess-tests-wk2/build/layout-test-results/http/tests/webAPIStatistics/canvas-read-and-write-data-collection-actual.txt
@@ -9,3 +9,11 @@
     isPrevalentResource: No
     isVeryPrevalentResource: No
     dataRecordsRemoved: 0
+Registrable domain: nullOrigin
+    hadUserInteraction: No
+    mostRecentUserInteraction: -1
+    grandfathered: No
+    IsScheduledForAllButCookieDataRemoval: No
+    isPrevalentResource: No
+    isVeryPrevalentResource: No
+    dataRecordsRemoved: 0

Comment 1 Radar WebKit Bug Importer 2022-03-30 16:24:00 PDT
Comment 2 Robert Jenner 2022-03-31 14:28:51 PDT
Marked expectations for test here:

Comment 3 Ryan Haddad 2022-04-01 10:23:03 PDT
Fixed test expectations for macOS in https://commits.webkit.org/249127@main
Comment 4 Myles C. Maxfield 2022-04-01 16:53:55 PDT
Reverting r292072 makes this test pass again.
Comment 5 Ryan Haddad 2022-04-01 17:28:29 PDT
It looks like disabling this test for EWS (since flaky/failing tests are skipped) has caused the failure to move to a different webAPIStatistics test: https://ews-build.s3-us-west-2.amazonaws.com/Commit-Queue/456407-21304/results.html
Comment 6 Ryan Haddad 2022-04-01 17:44:58 PDT
Resolved by revert via https://bugs.webkit.org/show_bug.cgi?id=238690

Removed expectations in https://commits.webkit.org/249144@main
Comment 7 Myles C. Maxfield 2022-04-01 20:01:24 PDT
I understand what's happening now:

1. InjectedBundle::initialize() runs, which calls activateFonts() (which installs WebKit's testing fonts for the local (web) process. This queues up a notification (which is asynchronously delivered).
2. WebProcess::createWebPage() runs, which loads a dummy empty page, which uses -webkit-standard, and so we end up calling realizeNextFallback() and therefore WebResourceLoadObserver::logFontLoad(). This populates some dummy statistics in the WebResourceLoadObserver under the domain "nullOrigin".
3. InjectedBundle::beginTesting() runs, which calls WebResourceLoadObserver::clearState(). The previously-recorded statistics are now gone.
4. The pending notification gets delivered. The page is still the dummy page. The style recalc ends up calling realizeNextFallback() and therefore WebResourceLoadObserver::logFontLoad(). This populates some more dummy statistics in the WebResourceLoadObserver under the domain "nullOrigin". Before r292072 this didn't use to happen.
5. The test runs, loads some stuff, and dumps the contents of the WebResourceLoadObserver. The contents contain both statistics that the test intentionally created, as well as the dummy statistics that was placed there by the layout the notification caused.
Comment 8 Myles C. Maxfield 2022-04-01 20:02:10 PDT
Reopening because there is work to do to make the test work properly.
Comment 9 Myles C. Maxfield 2022-04-01 20:03:26 PDT
One thing to realize from the above story is that this problem only occurs during testing. Real users wouldn't actually encounter this problem.
Comment 10 Myles C. Maxfield 2022-04-01 20:46:08 PDT
Created attachment 456438 [details]
Comment 11 Myles C. Maxfield 2022-04-01 21:24:38 PDT
Created attachment 456442 [details]
Comment 12 Myles C. Maxfield 2022-04-01 21:34:26 PDT
Putting back in config changed, so I can continue this in https://bugs.webkit.org/show_bug.cgi?id=238483