Closed Bug 753757 Opened 12 years ago Closed 12 years ago

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

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

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

RESOLVED FIXED
Tracking Status
firefox12 --- fixed
firefox13 --- fixed
firefox14 --- fixed
firefox15 --- fixed
firefox-esr10 --- fixed
status1.9.2 --- wontfix

People

(Reporter: vladmaniac, Assigned: whimboo)

References

()

Details

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

Attachments

(2 files, 3 obsolete files)

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
Whiteboard: [mozmill-test-failure]
This is reproducible locally also with Firefox 15
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.
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.
(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
There will be no events. So just compare the window count.
I will take it since no-one is assigned yet.
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Whiteboard: [mozmill-test-failure] → [mozmill-test-failure][lib]
Attached patch Make use of windowMap (v1) (obsolete) — Splinter Review
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)
Looks like to be a regression from bug 751242 across all branches.
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}}
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.
Attached patch Make use of windowMap (v2) (obsolete) — Splinter Review
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+
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+
Landed as:
http://hg.mozilla.org/qa/mozmill-tests/rev/e614325a27dc

Lets wait for results before backporting the patch.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
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 → ---
Really silly mistake we did here. I will upload a patch in a minute.
Attached patch Really wait for window closed (obsolete) — Splinter Review
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+
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+
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
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-test-failure][lib] → [mozmill-test-failure][lib][qa-]
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: