Troubleshoot.sys.mjs: FAIL A promise chain failed to handle a rejection: WebGPU is disabled by blocklist.
Categories
(Core :: Graphics: WebGPU, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox113 | --- | fixed |
People
(Reporter: jimb, Assigned: jimb)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Troubleshoot.snapshot
fails to handle errors thrown by navigator.gpu.requestAdapter
when WebGPU is blocklisted, preffed off, or otherwise unavailable, causing mochitests unrelated to WebGPU to fail when they check for unhandled rejected promises.
The function navigator.gpu.requestAdapter
is the main entry point for the WebGPU API. Its C++ implementation, mozilla::webgpu::Instance::RequestAdapter
, returns a rejected promise if WebGPU is disabled for any of various reasons: blocklists, being on a beta or release build, or disabled by pref.
The function GetWebgpuInfo
calls navigator.gpu.requestAdapter
to gather information for about:support
, and fails to catch errors. Since Troubleshoot.snapshot
calls that, it will fail in turn. And since Troubleshoot.snapshot
is called in the process of running mochitests, this causes mochitests that have nothing to do with WebGPU (for example, browser/base/content/test/tabs/browser_navigatePinnedTab.js
) to fail with messages like this:
Unexpected Results
------------------
browser/base/content/test/tabs/browser_navigatePinnedTab.js
FAIL A promise chain failed to handle a rejection: WebGPU is disabled by blocklist. - stack: GetWebgpuInfo@resource://gre/modules/Troubleshoot.sys.mjs:774:43
graphics/<@resource://gre/modules/Troubleshoot.sys.mjs:809:41
graphics@resource://gre/modules/Troubleshoot.sys.mjs:815:7
snapshot/<@resource://gre/modules/Troubleshoot.sys.mjs:188:30
snapshot@resource://gre/modules/Troubleshoot.sys.mjs:176:12
onload@chrome://global/content/aboutSupport.js:36:18
EventListener.handleEvent*@chrome://global/content/aboutSupport.js:33:8
Assignee | ||
Comment 1•2 years ago
|
||
If anything in Troubleshoot.sys.mjs's GetWebgpuInfo throws an error, capture that and return it as the snapshot's data for WebGPU. This ensures that blocklist rejections of WebGPU, currently used on macOS, result in developer-readable data in about:support
output, rather than a truncated graphics report.
Without this, the immediately-invoked asynchronous function expression at the end of the graphics
data provider throws. Since nothing awaits its promise (it calls the done
callback function explicitly), the runtime notices the unhandled rejected promise and reports it. The mochitest harness checks for this sort of thing and fails the test.
The broader problem here is that, given the way Troubleshoot.snapshot
's error handling is written, data sources need to do all their own error handling for any asynchronous work, which (as we see here) is error-prone. Filed Bug 1824761 for cleaning that up.
Updated•2 years ago
|
Comment 2•2 years ago
|
||
(In reply to Jim Blandy :jimb from comment #0)
Troubleshoot.snapshot
fails to handle errors thrown bynavigator.gpu.requestAdapter
when WebGPU is blocklisted, preffed off, or otherwise unavailable, causing mochitests unrelated to WebGPU to fail when they check for unhandled rejected promises.
Do you have an infra example? Or does this just happen locally or with non-default settings for mochitests or something?
Assignee | ||
Comment 3•2 years ago
|
||
This only shows up when we try to land bug 1746245, because WebGPU API (navigator.gpu
and friends, see dom/webidl/WebGPU.webidl
) becomes available in tests that didn't explicitly flip the pref themselves. Since WebGPU is available but blocklisted on macOS, Troubleshoot.snapshot
tries to call navigator.gpu.requestAdapter
and gets an error, which is the case we hadn't tested for.
Comment 5•2 years ago
|
||
bugherder |
Updated•1 year ago
|
Comment 8•1 year ago
|
||
Set release status flags based on info from the regressing bug 1808571
Description
•