Race condition in devtools/client/framework/test/browser_about-devtools-toolbox_reload.js

RESOLVED FIXED in Firefox 69

Status

defect
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: jorendorff, Unassigned)

Tracking

unspecified
Firefox 69
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

In bug 1546145, I'm changing await to be about 2x faster (each await currently creates an extra Promise, for no good reason—it's redundant—and the change is to stop doing that).

This breaks some tests, including this one.

Sample log output:

00:40:00     INFO - Check if about:devtools-toolbox was reloaded correctly
00:40:00     INFO - TEST-PASS | devtools/client/framework/test/browser_about-devtools-toolbox_reload.js | about:devtools-toolbox header is correctly displayed - 
00:40:00     INFO - Removing tab.
00:40:00     INFO - Waiting for event: 'TabClose' on [object XULElement].
00:40:00     INFO - Got event: 'TabClose' on [object XULElement].
00:40:00     INFO - Tab removed and finished closing
00:40:00     INFO - Removing tab.
00:40:00     INFO - Waiting for event: 'TabClose' on [object XULElement].
00:40:00     INFO - Got event: 'TabClose' on [object XULElement].
00:40:00     INFO - Tab removed and finished closing
00:40:00     INFO - Leaving test bound 
00:40:00     INFO - Buffered messages finished
00:40:00     INFO - TEST-UNEXPECTED-FAIL | devtools/client/framework/test/browser_about-devtools-toolbox_reload.js | A promise chain failed to handle a rejection: [Exception... "Component is not available"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://devtools/client/framework/toolbox.js :: _onTargetClosed :: line 832"  data: no] - stack: _onTargetClosed@resource://devtools/client/framework/toolbox.js:832:20
00:40:00     INFO - emit@resource://devtools/shared/event-emitter.js:186:24
00:40:00     INFO - emit@resource://devtools/shared/event-emitter.js:267:18
00:40:00     INFO - TargetMixin/destroy/this._destroyer<@resource://devtools/shared/fronts/targets/target-mixin.js:526:14
00:40:00     INFO - destroy@resource://devtools/shared/fronts/targets/target-mixin.js:570:9
00:40:00     INFO - destroy@resource://devtools/shared/fronts/targets/browsing-context.js:140:27
00:40:00     INFO - emit@resource://devtools/shared/event-emitter.js:186:24
00:40:00     INFO - emit@resource://devtools/shared/event-emitter.js:267:18
00:40:00     INFO - onPacket@resource://devtools/shared/protocol.js:1424:13
00:40:00     INFO - onPacket@resource://devtools/shared/client/debugger-client.js:602:13
00:40:00     INFO - send/<@resource://devtools/shared/transport/local-transport.js:64:23
00:40:00     INFO - exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:22
00:40:00     INFO - DevToolsUtils.executeSoon*exports.executeSoon@resource://devtools/shared/DevToolsUtils.js:55:21
00:40:00     INFO - send@resource://devtools/shared/transport/local-transport.js:58:21
00:40:00     INFO - send@resource://devtools/server/main.js:1023:20
00:40:00     INFO - connectToFrame/</destroy<@resource://devtools/server/main.js:812:22
00:40:00     INFO - exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:22
00:40:00     INFO - onMessageManagerClose@resource://devtools/server/main.js:830:11
00:40:00     INFO - _endRemoveTab@chrome://browser/content/tabbrowser.js:3150:13
00:40:00     INFO - removeTab@chrome://browser/content/tabbrowser.js:2848:12
00:40:00     INFO - removeTab@chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js:192:12
00:40:00     INFO - @chrome://mochitests/content/browser/devtools/client/framework/test/browser_about-devtools-toolbox_reload.js:41:9
00:40:00     INFO - Async*Tester_execTest/<@chrome://mochikit/content/browser-test.js:1116:34
00:40:00     INFO - Tester_execTest@chrome://mochikit/content/browser-test.js:1144:12
00:40:00     INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1005:14
00:40:00     INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:803:59
00:40:00     INFO - Rejection date: Fri May 17 2019 00:40:00 GMT+0000 (Greenwich Mean Time) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 257
00:40:00     INFO - Stack trace:
00:40:00     INFO - resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:257
00:40:00     INFO - chrome://mochikit/content/browser-test.js:nextTest:755
00:40:00     INFO - chrome://mochikit/content/browser-test.js:testScope/test_finish/<:1417
00:40:00     INFO - chrome://mochikit/content/browser-test.js:run:1354
00:40:00     INFO - GECKO(1974) | JavaScript error: resource://devtools/client/framework/toolbox.js, line 832: NS_ERROR_NOT_AVAILABLE
00:40:00     INFO - GECKO(1974) | MEMORY STAT | vsize 5983MB | residentFast 843MB | heapAllocated 600MB
00:40:00     INFO - TEST-OK | devtools/client/framework/test/browser_about-devtools-toolbox_reload.js | took 1901ms
00:40:00     INFO - checking window state
00:40:00     INFO - GECKO(1974) | console.warn: "Error while detaching the browsing context target front: undefined"
00:40:00     INFO - Console message: [JavaScript Error: "NS_ERROR_NOT_AVAILABLE" {file: "resource://devtools/client/framework/toolbox.js" line: 832}]

This also appears in the log. Not sure if it's relevant.

 23:17:57     INFO - GECKO(2199) | console.error: (new TypeError("this._walker is undefined", "resource://devtools/client/accessibility/accessibility-startup.js", 137))

i've seen the walker too. i think it is okay

I tried skip-if=true on this test, just to see. The rest of the devtools tests are beautifully green.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e51aafeafc401ff55df2420eecd53d58decc120

OK, I found a change that causes the test to pass. My only concern is if the pre-existing code was like that for a reason. Apparently related to bug 1536144?

Priority: -- → P1
Type: task → defect
Component: JavaScript Engine → General
Priority: P1 → --
Product: Core → DevTools
Attachment #9065884 - Attachment is obsolete: true

I think this needs to move to the about:debugging component.

Component: General → about:debugging
Pushed by jorendorff@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5d620aaff95a
Fix race condition in a devtools test. r=jdescottes,jlast
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.