Closed Bug 1142633 Opened 6 years ago Closed 6 years ago

Intermittent browser_net_complex-params.js | A promise chain failed to handle a rejection: - undefined | Test timed out | Found a tab

Categories

(DevTools :: Netmonitor, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox37 wontfix, firefox38 fixed, firefox39 fixed, firefox-esr31 unaffected)

RESOLVED FIXED
Firefox 39
Tracking Status
firefox37 --- wontfix
firefox38 --- fixed
firefox39 --- fixed
firefox-esr31 --- unaffected

People

(Reporter: RyanVM, Assigned: sjakthol)

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

04:03:09 INFO - 4851 INFO TEST-START | browser/devtools/netmonitor/test/browser_net_complex-params.js
04:03:11 INFO - JavaScript error: , line 0: Error: operation not possible on dead CPOW
04:03:17 INFO - 4852 INFO checking window state
04:03:17 INFO - 4853 INFO Console message: [JavaScript Error: "Handler function NetworkEventActorProxy.addResponseContent threw an exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIMessageSender.sendAsyncMessage]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/network-monitor.js :: NetworkEventActorProxy.methodFactory/< :: line 1220" data: no]
04:03:17 INFO - Stack: NetworkEventActorProxy.methodFactory/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/network-monitor.js:1220:0
04:03:17 INFO - makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js:82:13
04:03:17 INFO - NRL__onComplete@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/network-monitor.js:356:0
04:03:17 INFO - NRL_onStreamClose@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/network-monitor.js:308:6
04:03:17 INFO - NRL_onInputStreamReady@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/network-monitor.js:400:6
04:03:17 INFO - Line: 1220, column: 0" {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/DevToolsUtils.js" line: 58}]
04:03:17 INFO - 4854 INFO Console message: [JavaScript Warning: "unsafe CPOW usage" {file: "resource:///modules/sessionstore/TabState.jsm" line: 96}]
04:03:17 INFO - 4855 INFO Console message: [JavaScript Warning: "unsafe CPOW usage" {file: "resource:///modules/sessionstore/TabState.jsm" line: 96}]
04:03:17 INFO - 4856 INFO Initializing a network monitor pane.
04:03:17 INFO - 4857 INFO Adding tab: http://example.com/browser/browser/devtools/netmonitor/test/html_params-test-page.html
04:03:17 INFO - 4858 INFO Net tab added successfully: http://example.com/browser/browser/devtools/netmonitor/test/html_params-test-page.html
04:03:17 INFO - 4859 INFO Console message: [JavaScript Warning: "unsafe CPOW usage" {file: "chrome://mochitests/content/browser/browser/devtools/netmonitor/test/head.js" line: 142}]
04:03:17 INFO - 4860 INFO Console message: [JavaScript Error: "Error: operation not possible on dead CPOW"]
04:03:17 INFO - 4861 INFO TEST-UNEXPECTED-FAIL | browser/devtools/netmonitor/test/browser_net_complex-params.js | A promise chain failed to handle a rejection: - undefined
04:03:17 INFO - Stack trace:
04:03:17 INFO - JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: PendingErrors.register :: line 162
04:03:17 INFO - JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: this.PromiseWalker.completePromise :: line 675
04:03:17 INFO - JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: Handler.prototype.process :: line 903
04:03:17 INFO - JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: this.PromiseWalker.walkerLoop :: line 746
04:03:17 INFO - JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: this.PromiseWalker.scheduleWalkerLoop/< :: line 688
04:03:17 INFO - native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
04:03:25 INFO - 4862 INFO Console message: 1426158205722 Toolkit.GMP WARN GMPInstallManager.parseResponseXML got node name: html, expected: updates
04:03:25 INFO - 4863 INFO Console message: [JavaScript Error: "1426158205723 Toolkit.GMP ERROR GMPInstallManager.simpleCheckAndInstall Could not check for addons: {"target":{},"message":"got node name: html, expected: updates"}" {file: "resource://gre/modules/Log.jsm" line: 749}]
04:03:25 INFO - 4864 INFO Console message: 1426158205816 Services.HealthReport.HealthReporter WARN Saved state file does not exist.
04:03:55 INFO - Xlib: extension "RANDR" missing on display ":0".
04:03:56 INFO - TEST-INFO | screentopng: exit 0
04:03:56 INFO - 4865 INFO TEST-UNEXPECTED-FAIL | browser/devtools/netmonitor/test/browser_net_complex-params.js | Test timed out - expected PASS
04:03:56 INFO - 4866 INFO finish() was called, cleaning up...
04:03:56 INFO - 4867 INFO MEMORY STAT vsize after test: 921337856
04:03:56 INFO - 4868 INFO MEMORY STAT residentFast after test: 198062080
04:03:56 INFO - 4869 INFO MEMORY STAT heapAllocated after test: 80823568
04:03:56 INFO - 4870 INFO TEST-OK | browser/devtools/netmonitor/test/browser_net_complex-params.js | took 45071ms
04:03:56 INFO - 4871 INFO TEST-UNEXPECTED-FAIL | browser/devtools/netmonitor/test/browser_net_complex-params.js | Found a tab after previous test timed out: http://example.com/browser/browser/devtools/netmonitor/test/html_params-test-page.html - expected PASS
I think I figured what has been causing these dead CPOW failures in netmonitor tests.

The tests start by a call to initNetMonitor. It opens a tab with the given URL and takes a reference to the content window at line 142[1]. Then, at line 148[2] toggleCache is called which causes the tab to reload (if required). And here's the problem: we now have a reference to the old content window waiting to be GC'd passed to the test. Given enough time for GC to occur, this reference will die causing the dead CPOW error which in turn leads to the promise rejection.

This patch fixes the issue by storing the reference to the content window only AFTER the the tab is reconfigured (i.e. reloaded). Of course it would be better to stop using the debuggee directly but that's a whole lot bigger task.

Hopefully, it'll fix bug 1138981 and 1139988 too.

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c5c35d41e9f8

[1] https://dxr.mozilla.org/mozilla-central/source/browser/devtools/netmonitor/test/head.js#142
[2] https://dxr.mozilla.org/mozilla-central/source/browser/devtools/netmonitor/test/head.js#148
Assignee: nobody → sjakthol
Status: NEW → ASSIGNED
Attachment #8577075 - Flags: review?(vporof)
Attachment #8577075 - Flags: review?(vporof) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/e939387694c1
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/e939387694c1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 39
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.