Bug 210991

Summary: [iOS] Always run WKTR's WKWebViews at foreground priority
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Severity: Normal CC: ap, ggaren, jlewis3, keith_miller, ryanhaddad, tsavell, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch none

Description Chris Dumez 2020-04-24 13:28:33 PDT
Always run WKTR's WKWebViews at foreground priority. This makes sure that they don't suspend and run at foreground priority on iOS, even if those views are not visible on screen.
This is an issue to address flakiness on the bots.
Comment 1 Chris Dumez 2020-04-24 13:29:25 PDT
Created attachment 397496 [details]
Comment 2 Keith Miller 2020-04-24 13:36:48 PDT
Comment on attachment 397496 [details]

Comment 3 EWS 2020-04-24 15:29:47 PDT
Committed r260675: <https://trac.webkit.org/changeset/260675>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397496 [details].
Comment 4 Radar WebKit Bug Importer 2020-04-24 15:30:24 PDT
Comment 5 Alexey Proskuryakov 2020-04-25 17:30:28 PDT
Now I'm curious if this reduced the flakiness, and how WKTR's view could be invisible in the first place.
Comment 6 Chris Dumez 2020-04-25 17:49:13 PDT
(In reply to Alexey Proskuryakov from comment #5)
> Now I'm curious if this reduced the flakiness, and how WKTR's view could be
> invisible in the first place.

Well, the plan is the monitor the known flaky tests on iOS and see. How can the views be not visible? I have a couple of theories:
- we are using simulators, sometimes multiple ones to run tests in parallel. How do we know all simulators are visible? E.g can one simulator be on top of another?
- some tests open new windows but on iOS we normally only display only 1 window at a time on screen.
- we may have issues determining visibility accurately in the simulator.

I will note that we disabled suspension for api tests on iOS about a year ago and it definitely addressed some of the flakiness that we were seeing. We did so by lying and saying that the views were visible at all times.

In any case, I will monitor tests with this change and I plan to look into tests that seem to have become flaky after adopting running board assertion to identify why next week.