MarionetteException gets thrown during shutdown due to inappropriate usage of setTimeout

RESOLVED FIXED in Firefox 48

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

({pi-marionette-server})

49 Branch
mozilla49
pi-marionette-server
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox48 fixed, firefox49 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
Created attachment 8750934 [details]
proposed patch

With the landing of bug 1123506 we have seen a regression in our Firefox UI tests which is filed as bug 1271446. To reproduce run the following command in your local mozilla-central repository:

mach firefox-ui-functional --gecko-log - testing/firefox-ui/tests/functional/private_browsing/test_about_private_browsing.py testing/firefox-ui/tests/functional/security/test_dv_certificate.py

The exception thrown is:

 16:34:15     INFO -  Marionette threw an error: [Exception... "Component not initialized"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: chrome://marionette/content/evaluate.js :: evaluate.sandbox/promise< :: line 136"  data: no]

Source:

> => timeoutId = sb.window.setTimeout(
>        timeoutHandler, opts.timeout || DEFAULT_TIMEOUT);
>    sb.window.addEventListener("unload", unloadHandler);

Given that this happens while a chrome window gets closed the window reference might not exist anymore. A better solution would be to use the Timer.jsm to set the timeout, which would also fix our problem. See the attachment for a proposal.

https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Timer.jsm
(Assignee)

Updated

2 years ago
Attachment #8750934 - Attachment mime type: text/x-patch → text/plain
This patch looks fine.  Please ship if you feel confident with testing.
(Assignee)

Comment 2

2 years ago
After talking with Andreas on IRC I will take this bug. I will try again to figure out a minimized testcase. If I can't find one in time we will land the patch as is.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
(Assignee)

Comment 3

2 years ago
Created attachment 8751450 [details]
MozReview Request: Bug 1271758 - Ensure that execute_script does not fail on closed chrome windows. r?ato

Review commit: https://reviewboard.mozilla.org/r/52021/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52021/
Attachment #8751450 - Flags: review?(ato)
(Assignee)

Comment 4

2 years ago
Comment on attachment 8751450 [details]
MozReview Request: Bug 1271758 - Ensure that execute_script does not fail on closed chrome windows. r?ato

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52021/diff/1-2/
Comment on attachment 8751450 [details]
MozReview Request: Bug 1271758 - Ensure that execute_script does not fail on closed chrome windows. r?ato

https://reviewboard.mozilla.org/r/52021/#review49083

Please do a try run including the Mn tests.
Attachment #8751450 - Flags: review?(ato) → review+

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ea476de583db
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox49: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
(Assignee)

Updated

2 years ago
Flags: in-testsuite+

Comment 8

2 years ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-aurora/rev/d9a268310116
status-firefox48: --- → fixed
You need to log in before you can comment on or make changes to this bug.