Bug 1682921 - [devtools] Fix intermittent in browser_webconsole_stubs_evaluation_result.js . r=bomsy.

We're only hotfixing the test so it won't trigger an intermittent as the failure
is happening simply because we do get a null `sourceId` in packets sometimes.
Bug 1717037 was filed to properly fix this issue, but it might take some time
that we don't necesserally have at the moment, and since there's still value
in having this test to run, it's better to have this quick fix.

Differential Revision: https://phabricator.services.mozilla.com/D118191
This commit is contained in:
Nicolas Chevobbe 2021-06-21 12:16:13 +00:00
parent 7df7939f77
commit cdc500fd07

View File

@ -258,7 +258,11 @@ function getCleanedPacket(key, packet) {
if (Array.isArray(res.exceptionStack)) {
res.exceptionStack = res.exceptionStack.map((frame, i) => {
const existingFrame = existingPacket.exceptionStack[i];
if (frame && existingFrame && frame.sourceId) {
// We're replacing sourceId here even if the property in frame is null to avoid
// a frequent intermittent. The sourceId is retrieved from the Debugger#findSources
// API, which is not deterministic (See https://searchfox.org/mozilla-central/rev/b172dd415c475e8b2899560e6005b3a953bead2a/js/src/doc/Debugger/Debugger.md#367-375)
// This should be fixed in Bug 1717037.
if (frame && existingFrame && "sourceId" in frame) {
frame.sourceId = existingFrame.sourceId;
}
return frame;