Bug 1522790 Comment 53 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #52)
> Now Android wpt jobs are failing with TestRunner timeouts. Sadly I missed to enable remote trace logs for the last try build, so that I had to push again to try for just Android:
> 
> https://treeherder.mozilla.org/jobs?repo=try&revision=88cad767424e03d0200a40d188993870d7c23bda

The problem here seems actually be a delay in finish loading the new window on Android. This can be seen via logging as done to `adb logcat` and manifests in a `browser-delayed-startup-finished` notification that gets send out very late while other commands are already running. Current wptrunner is using `window.open()` and then awaits the `load` event for the new window's document if not yet finished loading. Right after a navigation is started for the test page. And here the WebProgress listener sees a hick-up and suddenly stops to work, resulting in the page never reaching the `readyState=complete` and the testharness to timeout.

With my patch to use Marionette's `NewWindow` command the problem is there as well but could be easily fixed by delaying the return of [`GeckoViewTabUtil.createNewTab()`](https://searchfox.org/mozilla-central/rev/058ab60e5020d7c5c98cf82d298aa84626e0cd79/mobile/android/modules/geckoview/GeckoViewTestUtils.sys.mjs#20-61 until the window has been finished initializing / loading. As of now this method only waits for the `geckoview-window-created` notification which actually is fired too early, and the navigation as triggered right after causes a collision with the navigation to the test page as triggered by wptrunner. Changing the notification to use `browser-delayed-startup-finished` as well will workaround the problem to let tests work correctly. Tests that could be used to demonstrate the behavior are under `/referrer-policy/generic/`.

My plan is to patch the `GeckoViewTabUtil.createNewTab()` function as mentioned above which would allow us to remove around 14.000 intermittent timeout entries across all wpt tests! Then I will file a bug to get the underlying issue investigated.
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #52)
> Now Android wpt jobs are failing with TestRunner timeouts. Sadly I missed to enable remote trace logs for the last try build, so that I had to push again to try for just Android:
> 
> https://treeherder.mozilla.org/jobs?repo=try&revision=88cad767424e03d0200a40d188993870d7c23bda

The problem here seems actually be a delay in finish loading the new window on Android. This can be seen via logging as done to `adb logcat` and manifests in a `browser-delayed-startup-finished` notification that gets send out very late while other commands are already running. Current wptrunner is using `window.open()` and then awaits the `load` event for the new window's document if not yet finished loading. Right after a navigation is started for the test page. And here the WebProgress listener sees a hick-up and suddenly stops to work, resulting in the page never reaching the `readyState=complete` and the testharness to timeout.

With my patch to use Marionette's `NewWindow` command the problem is there as well but could be easily fixed by delaying the return of [`GeckoViewTabUtil.createNewTab()`](https://searchfox.org/mozilla-central/rev/058ab60e5020d7c5c98cf82d298aa84626e0cd79/mobile/android/modules/geckoview/GeckoViewTestUtils.sys.mjs#20-61) until the window has been finished initializing / loading. As of now this method only waits for the `geckoview-window-created` notification which actually is fired too early, and the navigation as triggered right after causes a collision with the navigation to the test page as triggered by wptrunner. Changing the notification to use `browser-delayed-startup-finished` as well will workaround the problem to let tests work correctly. Tests that could be used to demonstrate the behavior are under `/referrer-policy/generic/`.

My plan is to patch the `GeckoViewTabUtil.createNewTab()` function as mentioned above which would allow us to remove around 14.000 intermittent timeout entries across all wpt tests! Then I will file a bug to get the underlying issue investigated.

Back to Bug 1522790 Comment 53