Bug 1775558 Comment 63 Edit History

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

The timeout failure is hit consistently after the error `[JavaScript Error: "TypeError: doc is null" {file: "resource:///actors/ContextMenuChild.sys.mjs" line: 559}]` is logged in the console, that is a error that I've seen and investigated before in other intermittents triggered in tests that are using `BrowserTestUtils.synthesizeMouseAtCenter`, e.g. see Bug 1484789 comment 29.

That underlying issue hit by `BrowserTestUtils.synthesizeMouseAtCenter` has been also reported by Rob as Bug 1478596, which I'm linking to this bugzilla issue as a seealso.

For this test the call to `BrowserTestUtils.synthesizeMouseAtCenter` is originated by the [openContextMenu helper defined in the head.js file here](https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/browser/components/extensions/test/browser/head.js#501-510), through the call to [openExtensionContextMenu helper also defined in the head.js file](https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/browser/components/extensions/test/browser/head.js#529).

There are other tests calling openExtensionContextMenu which are apparently not failing intermittently as often as this one, and so I suspect the chance to hit the issue may be raised a bit by the fact that this test is opening a tab from the test extension side and then as soon as the script loaded in the new tab is hit then it calls openExtensionContextMenu, while some other test like browser_ext_contextMenus.js (which doesn't seem to have any intermittent bugzilla issue open) is opening a new tab using BrowserTestUtils.openNewForegroundTab, awaiting on it and then proceeding with the test of the test and the call to openExtensionContextMenu, my guess is that this sequence is less likely to hit the race that makes `BrowserTestUtils.synthesizeMouseAtCenter` to hit the "TypeError: doc is null" error.

I could hit this issue often enough locally (I managed to hit it only once in a while) and so I may need to try to hit it in a try push and then try again after applying some changes to the test, e.g. to open the new tab BrowserTestUtils.openNewForegroundTab as browser_ext_contextMenus.js, to confirm if those changes would be enough to stop the intermittency.
The timeout failure is hit consistently after the error `[JavaScript Error: "TypeError: doc is null" {file: "resource:///actors/ContextMenuChild.sys.mjs" line: 559}]` is logged in the console, that is a error that I've seen and investigated before in other intermittents triggered in tests that are using `BrowserTestUtils.synthesizeMouseAtCenter`, e.g. see Bug 1484789 comment 29.

That underlying issue hit by `BrowserTestUtils.synthesizeMouseAtCenter` has been also reported by Rob as Bug 1478596, which I'm linking to this bugzilla issue as a seealso.

For this test the call to `BrowserTestUtils.synthesizeMouseAtCenter` is originated by the [openContextMenu helper defined in the head.js file here](https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/browser/components/extensions/test/browser/head.js#501-510), through the call to [openExtensionContextMenu helper also defined in the head.js file](https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/browser/components/extensions/test/browser/head.js#529).

There are other tests calling openExtensionContextMenu which are apparently not failing intermittently as often as this one, and so I suspect the chance to hit the issue may be raised a bit by the fact that this test is opening a tab from the test extension side and then as soon as the script loaded in the new tab is hit then it calls openExtensionContextMenu, while some other test like browser_ext_contextMenus.js (which doesn't seem to have any intermittent bugzilla issue open) is opening a new tab using BrowserTestUtils.openNewForegroundTab, awaiting on it and then proceeding with the test of the test and the call to openExtensionContextMenu, my guess is that this sequence is less likely to hit the race that makes `BrowserTestUtils.synthesizeMouseAtCenter` to hit the "TypeError: doc is null" error.

I couldn't hit this issue often enough locally (I managed to hit it only once in a while) and so I may need to try to hit it in a try push and then try again after applying some changes to the test, e.g. to open the new tab BrowserTestUtils.openNewForegroundTab as browser_ext_contextMenus.js, to confirm if those changes would be enough to stop the intermittency.

Back to Bug 1775558 Comment 63