Mozmill test failure /testPrivateBrowsing/testDownloadManagerClosed.js | "Window has been closed. "

RESOLVED FIXED

Status

Mozilla QA
Mozmill Tests
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: vladmaniac, Assigned: whimboo)

Tracking

({regression})

unspecified
regression

Firefox Tracking Flags

(firefox12 fixed, firefox13 fixed, firefox14 fixed, firefox15 fixed, firefox-esr10 fixed, status1.9.2 wontfix)

Details

(Whiteboard: [mozmill-test-failure][lib][qa-], URL)

Attachments

(2 attachments, 3 obsolete attachments)

(Reporter)

Description

5 years ago
Firefox build: 
Firefox 14.0a2 (14.0a2, en-US, 20120510042005)

Build from:
http://hg.mozilla.org/releases/mozilla-aurora/rev/56cc5a3c4316

Report:
http://mozmill-ci.blargon7.com/#/functional/report/c2b72632f20450b6d99d14c709b34990

Error:
TimeoutError@resource://mozmill/modules/utils.js:447 waitFor@resource://mozmill/modules/utils.js:485 handleWindow@resource://mozmill/stdlib/securable-module.js -> file:///var/folders/vq/bds4whmx4jg5n19nm5p_9xfr0000gp/T/tmpQDZQwC.mozmill-tests/lib/utils.js:404 @resource://mozmill/stdlib/securable-module.js -> file:///var/folders/vq/bds4whmx4jg5n19nm5p_9xfr0000gp/T/tmpQDZQwC.mozmill-tests/lib/downloads.js:332 @resource://mozmill/modules/frame.js -> file:///var/folders/vq/bds4whmx4jg5n19nm5p_9xfr0000gp/T/tmpQDZQwC.mozmill-tests/tests/functional/testPrivateBrowsing/testDownloadManagerClosed.js:64 @resource://mozmill/modules/frame.js:563 @resource://mozmill/modules/frame.js:632 @resource://mozmill/modules/frame.js:675 @resource://mozmill/modules/frame.js:512 @resource://mozmill/modules/frame.js:687 @resource://jsbridge/modules/server.js:184 @resource://jsbridge/modules/server.js:188 @resource://jsbridge/modules/server.js:288

Mozmill version:
1.5.12

Test location:
http://hg.mozilla.org/qa/mozmill-tests/file/e01e2f9ad8db/tests/functional/testPrivateBrowsing/testDownloadManagerClosed.js
(Reporter)

Updated

5 years ago
Whiteboard: [mozmill-test-failure]
(Reporter)

Updated

5 years ago
(Reporter)

Comment 1

5 years ago
This is reproducible locally also with Firefox 15
(Reporter)

Updated

5 years ago
status-firefox14: --- → affected
status-firefox15: --- → affected
The problem is in:
var closed = false;
        window.addEventListener("unload", function () { closed = true; }, false);
        window.close();
        mozmill.utils.waitFor(function () {
          return closed;
        }, "Window has been closed.");

So my guess is that the event listener gets destroyed when we close the window, so the event won't fire and set closed to true.
(Assignee)

Comment 3

5 years ago
We probably should compare the window count. But window.close() should always close the window. So not sure if we should test this at all.
We should check what events are available and see if we can use/adapt one.
(Reporter)

Comment 5

5 years ago
Top failure report 

http://mozmill-ci.blargon7.com/#/functional/report/c2b72632f20450b6d99d14c709b423b0

http://mozmill-ci.blargon7.com/#/functional/failure?branch=All&platform=All&from=2012-05-03&to=2012-05-10&test=%2FtestPrivateBrowsing%2FtestDownloadManagerClosed.js&func=testDownloadManagerClosed.js%3A%3AtestDownloadManagerClosed
(Reporter)

Comment 6

5 years ago
(In reply to Remus Pop (:RemusPop) from comment #4)
> We should check what events are available and see if we can use/adapt one.

A bunch of events here 
http://mxr.mozilla.org/mozilla-central/search?string=window.addEventListener
(Assignee)

Comment 7

5 years ago
There will be no events. So just compare the window count.
(Assignee)

Comment 8

5 years ago
I will take it since no-one is assigned yet.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Whiteboard: [mozmill-test-failure] → [mozmill-test-failure][lib]
(Assignee)

Comment 9

5 years ago
Created attachment 623064 [details] [diff] [review]
Make use of windowMap (v1)

We simply can make use of the windowMap now. Whoever comes first, please review so that we can get it landed ASAP. Thanks.
Attachment #623064 - Flags: review?(vlad.mozbugs)
(Assignee)

Comment 10

5 years ago
Looks like to be a regression from bug 751242 across all branches.
Blocks: 751242
status1.9.2: --- → wontfix
status-firefox-esr10: --- → affected
status-firefox12: --- → affected
status-firefox13: --- → affected
Keywords: regression
Tested on Nightly in Linux and it fails at testPreferences/testPaneRetention with:
ERROR | Test Failure: {"exception": {"message": "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUtils.sendKeyEvent]", "name": "NS_ERROR_FAILURE", "lineNumber": 339}}
(Assignee)

Comment 12

5 years ago
This is because of bug 754225 and which we will have to fix with a new 1.5 release. So I would say that we go ahead and land this. For a temporary fix I could include an additional sleep of about 100ms which will not be noticeable but should also fix the failure.
(Assignee)

Comment 13

5 years ago
Created attachment 623099 [details] [diff] [review]
Make use of windowMap (v2)

Updated patch with the additional sleep call.
Attachment #623064 - Attachment is obsolete: true
Attachment #623064 - Flags: review?(vlad.mozbugs)
Attachment #623099 - Flags: review?(remus.pop)
Comment on attachment 623099 [details] [diff] [review]
Make use of windowMap (v2)

Looks good and works fine. Please land.
Attachment #623099 - Flags: review?(remus.pop) → review+
(Assignee)

Comment 15

5 years ago
Created attachment 623102 [details] [diff] [review]
Updated patch for check-in

Sorry, there were some left over code in the test itself I had to remove.
Attachment #623099 - Attachment is obsolete: true
Attachment #623102 - Flags: review?(remus.pop)
Comment on attachment 623102 [details] [diff] [review]
Updated patch for check-in

Looks good to me.
Attachment #623102 - Flags: review?(remus.pop) → review+
(Assignee)

Comment 17

5 years ago
Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/e614325a27dc

Lets wait for results before backporting the patch.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
status-firefox15: affected → fixed
Resolution: --- → FIXED
(Assignee)

Comment 18

5 years ago
Also landed on all other branches:
http://hg.mozilla.org/qa/mozmill-tests/rev/89bd7909031c (aurora)
http://hg.mozilla.org/qa/mozmill-tests/rev/786f16e1e29a (beta)
http://hg.mozilla.org/qa/mozmill-tests/rev/98c8eca1d0ae (release)
http://hg.mozilla.org/qa/mozmill-tests/rev/b1cd00663a2f (esr10)

At best we should now be on 0 failures across branches. Lets look for tomorrows results.
status-firefox-esr10: affected → fixed
status-firefox12: affected → fixed
status-firefox13: affected → fixed
status-firefox14: affected → fixed
(Assignee)

Comment 19

5 years ago
Not sure why but there are still some failures lingering around:
http://mozmill-ci.blargon7.com/#/functional/report/c2b72632f20450b6d99d14c709e7c5dd

Seems to be intermittent orange. I will have to further check what's going on here.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 20

5 years ago
Really silly mistake we did here. I will upload a patch in a minute.
Status: REOPENED → ASSIGNED
status-firefox-esr10: fixed → affected
status-firefox12: fixed → affected
status-firefox13: fixed → affected
status-firefox14: fixed → affected
status-firefox15: fixed → affected
(Assignee)

Comment 21

5 years ago
Created attachment 624539 [details] [diff] [review]
Really wait for window closed
Attachment #624539 - Flags: review?(dave.hunt)
Comment on attachment 624539 [details] [diff] [review]
Really wait for window closed

r+ of course!
Attachment #624539 - Flags: review?(dave.hunt) → review+
(Assignee)

Comment 23

5 years ago
Created attachment 624542 [details] [diff] [review]
Really wait for window closed (v2)

In fact we can even remove the sleep call now! \o/
Attachment #624539 - Attachment is obsolete: true
Attachment #624542 - Flags: review?(dave.hunt)
Comment on attachment 624542 [details] [diff] [review]
Really wait for window closed (v2)

It just keeps getting better!
Attachment #624542 - Flags: review?(dave.hunt) → review+
(Assignee)

Comment 25

5 years ago
Landed on default:
http://hg.mozilla.org/qa/mozmill-tests/rev/e31f0088a48b

I will trigger a test-run for each platform to confirm it is fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago5 years ago
status-firefox15: affected → fixed
Resolution: --- → FIXED
(Assignee)

Comment 26

5 years ago
Failure is not visible anymore. Lets get it landed on other branches:

http://hg.mozilla.org/qa/mozmill-tests/rev/29891037c4f8 (aurora)
http://hg.mozilla.org/qa/mozmill-tests/rev/7389712a0abb (beta)
http://hg.mozilla.org/qa/mozmill-tests/rev/1d38824b338b (release)
http://hg.mozilla.org/qa/mozmill-tests/rev/5536f0fd76a6 (esr10)
status-firefox-esr10: affected → fixed
status-firefox12: affected → fixed
status-firefox13: affected → fixed
status-firefox14: affected → fixed
Whiteboard: [mozmill-test-failure][lib] → [mozmill-test-failure][lib][qa-]
You need to log in before you can comment on or make changes to this bug.