Closed Bug 940232 Opened 11 years ago Closed 11 years ago

Test failure "AddonsManager_isAddonInstalled: Add-on has been specified. - got 'undefined'" in /restartTests/testAddons_InstallAddonWithoutEULA/test2.js

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect, P1)

defect

Tracking

(firefox27 fixed, firefox28 fixed)

RESOLVED FIXED
Tracking Status
firefox27 --- fixed
firefox28 --- fixed

People

(Reporter: andrei, Assigned: cosmin-malutan)

References

()

Details

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

Attachments

(1 file)

Module:    testInstallAddonWithEULA
Test:      restartTests/testAddons_InstallAddonWithoutEULA/test2.js    
Failure:   AddonsManager_isAddonInstalled: Add-on has been specified. - got 'undefined'
Branches:  default
Platforms: Windows 8

I have not been able to reproduce this failure.
Tried on Windows 8 and OSX

This has been run with Australis merged into Nightly.
That might be a possible cause.
I managed to reproduce this on Windows 8 (while running tests for mozmill 2.0.1)

The error I see has more context:

> *** ERROR addons.xpi: Failed to close file for c:\users\user\appdata\local\temp\tmp42izyv.mozrunner\extensions\staged\{8620c15f-30dc-4dba-a131-7c5d20cf4a29}\chrome\locale\en-US\variables.properties
> *** ERROR addons.xpi: extractFilesAsync: failed to extract file c:\users\user\appdata\local\temp\tmp42izyv.mozrunner\extensions\staged\{8620c15f-30dc-4dba-a131-7c5d20cf4a29}\chrome\locale\en-US\variables.properties: Error: OS.File has been shut down. (resource://gre/modules/osfile/osfile_async_front.jsm:123)
> TEST-START | restartTests\testAddons_InstallAddonWithoutEULA\test2.js | setupModule
> TEST-START | restartTests\testAddons_InstallAddonWithoutEULA\test2.js | testInstallAddonWithEULA
> ERROR | Test Failure | {
>   "exception": {
>     "message": "AddonsManager_isAddonInstalled: Add-on has been specified. - got 'undefined'",
>     "lineNumber": 349,
>     "name": "Error",
>     "fileName": "file:///c:/work/bugs/temp/mozmill-tests/lib/addons.js"
>   }
> }
> TEST-UNEXPECTED-FAIL | restartTests\testAddons_InstallAddonWithoutEULA\test2.js | testInstallAddonWithEULA
I also see this on OSX with mozmill 2.0
All the time
> *** ERROR addons.xpi: extractFilesAsync: failed to extract file /var/folders/9l/sn_p3bw914s360j602z20jsc0000gq/T/tmpZu6xWl.mozrunner/extensions/staged/{8620c15f-30dc-4dba-a131-7c5d20cf4a29}/components/aboutNightly.js: Error: OS.File has been shut down. (resource://gre/modules/osfile/osfile_async_front.jsm:123)

Same error, reproducible.
Looks Australis related.
Priority: P4 → P1
Please test with a build from the holly branch to be fully sure.
This is not Australis related.
I'll come with a regression range
This is an interesting failure.

This would fail every time while I used newer builds.
Once I used an older build that passed the test, I wasn't able to reproduce the issue even on the build that previously failed every time.

After a long while, older builds would fail again. But again, after successfully passing the test on an older build, I can't reproduce it anymore.

I'd blame some sort of caching for this inconsistency, but it is too early to tell.
But the failure announces a file in a tmp folder which shouldn't get used again.

Ugh
mozilla-central pushlog would be:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f003c386c77a&tochange=9e571ad29946

And cross-examining the pushlog and commits done to the file mentioned in the error message
(resource://gre/modules/osfile/osfile_async_front.jsm) makes a likely contender:
http://hg.mozilla.org/mozilla-central/rev/8898b6c66941

Which adds lz4 (probably not this) _and_ async file read.

**
I seem to have better results (in getting the test to fail) with running the affected test right after completely clearing the browser cache.
Blocks: 854169
I read the code wrong, it doesn't really seem to be async support in the above mentioned commit.
I'll dig deeper into our code.
Found something similar (if not the same issue) in bug 932361
Erm bug 932361 also landed on the 8th November on mozilla-central, and it changed how XPI's get unzipped/installed (which is where we apparentlyfail).
This looks more plausible.

I'll probably need to build FF to test this, there are no tinderbox builds
Blocks: 932361
No longer blocks: 854169
Assignee: nobody → andrei.eftimie
(In reply to Andrei Eftimie from comment #9)
> I'll probably need to build FF to test this, there are no tinderbox builds

Why that? I see a lot of tinderbox builds at this time in the archive:
http://inbound-archive.pub.build.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/

Blair, do you have an idea what could be the cause of this problem?
I don't know why I thought that we had no tinderbox builds directly in mozilla-central.

Well, here is a pushlog from the aforementioned builds:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a6e7f0663458&tochange=361a24da7112

And we do have bug 932361 with 
http://hg.mozilla.org/mozilla-central/rev/38b01389507d in there.

Dave or Blair, do you any insight on the cause of this problem?
Flags: needinfo?(dtownsend+bugmail)
Flags: needinfo?(bmcbride)
The message "Error: OS.File has been shut down" suggests that something is trying to install an extension after the application has started closing
Flags: needinfo?(dtownsend+bugmail)
How often is this? We might want a skip patch.
Status: NEW → ASSIGNED
I suspect what's happening is that the test has been making an assumption that that part of the install is synchronous - so it requests a add-on be installed, then *immediately* checks if the add-on is installed and shuts down. Meanwhile, the install is still happening in the background - which leads to the error mentioned in comment 12.

We should probably handle that case better in the Add-on Manager code (filed bug 942661), but it won't actually fix the test here.
Flags: needinfo?(bmcbride)
This fails due to asynchronously installation of addons, and because we don't wait for installation to complete, and and we restart the firefox after we hit the install button. I made a fix patch, and I will be back with reports soon.
Comment on attachment 8339917 [details] [diff] [review]
patch_v1.0

Review of attachment 8339917 [details] [diff] [review]:
-----------------------------------------------------------------

This seems right to me. Please check other test in which we do the same to make the same change.
http://hg.mozilla.org/qa/mozmill-tests/rev/0c92878da7c5 (default)
Attachment #8339917 - Flags: review?(andrei.eftimie)
Attachment #8339917 - Flags: review?(andreea.matei)
Attachment #8339917 - Flags: review+
I haven't seen any other so far, the aurora branch is affected and the patch applies, we don't have the test on other branches.
Transplanted:
http://hg.mozilla.org/qa/mozmill-tests/rev/bfe15fa3ab7a (mozilla-aurora)

We should be good here.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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: