Converting ShadersEditorsView.destroy from Task to async function introduces test failures

RESOLVED INVALID

Status

defect
RESOLVED INVALID
Last year
4 months ago

People

(Reporter: ochameau, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Converting this function:
https://searchfox.org/mozilla-central/rev/40b1baaab5aba21223590ae1029e916dfd5ff7cd/devtools/client/shadereditor/shadereditor.js#382
to async function, introduces failure like this:

$ ./mach mochitest devtools/client/shadereditor/test/browser_se_aaa_run_first_leaktest.js
TEST-PASS | devtools/client/shadereditor/test/browser_se_aaa_run_first_leaktest.js | Should have a panel available. - 
Destroying the specified shader editor.
Waiting for event: 'destroyed' on [object Object].
Removing tab.
Waiting for event: 'TabClose' on [object XULElement].
Got event: 'TabClose' on [object XULElement].
Tab removed and finished closing
Console message: [JavaScript Warning: "Key event not available on some keyboard layouts: key=“r” modifiers=“accel,alt” id=“key_toggleReaderMode”" {file: "chrome://browser/content/browser.xul" line: 0}]
Console message: [JavaScript Warning: "Key event not available on some keyboard layouts: key=“r” modifiers=“accel,alt” id=“key_quickRestart”" {file: "chrome://browser/content/browser.xul" line: 0}]
Console message: [JavaScript Warning: "Key event not available on some keyboard layouts: key=“i” modifiers=“accel,alt,shift” id=“key_browserToolbox”" {file: "chrome://browser/content/browser.xul" line: 0}]




Failed to retrieve MOZ_UPLOAD_DIR env var
TEST-UNEXPECTED-FAIL | devtools/client/shadereditor/test/browser_se_aaa_run_first_leaktest.js | Test timed out - 
Forcing GC after shadereditor test.
GECKO(3359) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
GECKO(3359) | MEMORY STAT | vsize 2231MB | residentFast 343MB | heapAllocated 129MB
TEST-OK | devtools/client/shadereditor/test/browser_se_aaa_run_first_leaktest.js | took 45534ms
checking window state
GECKO(3359) | must wait for focus
Console message: [JavaScript Warning: "Use of nsIFile in content process is deprecated." {file: "resource://gre/modules/FileUtils.jsm" line: 170}]
GECKO(3359) | WARNING: At least one completion condition is taking too long to complete. Conditions: [{"name":"DevTools: Wait until toolbox is destroyed","state":"(none)","filename":"resource://devtools/shared/base-loader.js -> resource://devtools/client/framework/toolbox.js","lineNumber":2843,"stack":["resource://devtools/shared/base-loader.js -> resource://devtools/client/framework/toolbox.js:leakCheckObserver:2843","chrome://mochikit/content/browser-test.js:Tester.prototype.nextTest</<:923","chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:795"]}] Barrier: ShutdownLeaks: Wait for cleanup to be finished before checking for leaks

I tracked it down to `await this._toggleListeners("off");` never resolving, while the promise returned by `_toggleListeners` seems to resolve (callback passed to `then` method is called).
It looks like the issue with DOM promises from panel becoming frozen, but I don't see any DOM promise instanciated from the shadereditor document being instanciated here.
No longer blocks: 1440321
I put some time into investigating this. What I found is that `this._toggleListeners("off")` never resolves. Await has been used with this function before, so I'm stumped as to why it isn't working here.

the code successfully runs to the end for both "vs" and "fs" promises: https://searchfox.org/mozilla-central/rev/40b1baaab5aba21223590ae1029e916dfd5ff7cd/devtools/client/shadereditor/shadereditor.js#462

But it never resolves. I do not know if it is related to bug 1402779 or not, in which Promises can freeze during panel destruction.

Since this is not a trivial fix, but the panel is being removed anyway, this will be moved to being a dependency of the panel removal.
Blocks: 1342237
No longer blocks: 1365607
Product: Firefox → DevTools
The code behind DevTools:WebGL Shader Editor has gone away. Closing this bug as INVALID
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → INVALID
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.