Closed Bug 931715 Opened 12 years ago Closed 12 years ago

Test failure "The add-on has been correctly installed - got 'false'" in /restartTests/testInstallAddonWithoutEULA/test1.js

Categories

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

All
Windows Vista
defect

Tracking

(firefox25 unaffected, firefox26 unaffected, firefox27 fixed, firefox28 fixed, firefox-esr17 unaffected, firefox-esr24 unaffected)

RESOLVED FIXED
Tracking Status
firefox25 --- unaffected
firefox26 --- unaffected
firefox27 --- fixed
firefox28 --- fixed
firefox-esr17 --- unaffected
firefox-esr24 --- unaffected

People

(Reporter: mario.garbi, Assigned: mario.garbi)

References

()

Details

(Whiteboard: [mozmill-test-failure])

Attachments

(1 file, 5 obsolete files)

Assignee: nobody → mario.garbi
Status: NEW → ASSIGNED
I can reproduce it on the failing machine, will try to reproduce locally.
To bring an update here. I cannot reproduce this locally and on the failing machine the failures are intermittent. Might be that we are too fast and the Extensions tab isn't getting populated soon enough.
Attached patch waitForAMO.patch (obsolete) — Splinter Review
The recent failures were due to the fact that we were not waiting for AMO to populate the Extensions tab. Tested this on the failing machine and it works fine now.
Attachment #823375 - Flags: review?(andrei.eftimie)
Attachment #823375 - Flags: review?(andreea.matei)
Sorry, but I totally don't understand that. Why do we have to wait for AMO here?
Flags: needinfo?(mario.garbi)
Comment on attachment 823375 [details] [diff] [review] waitForAMO.patch Review of attachment 823375 [details] [diff] [review]: ----------------------------------------------------------------- Good catch Mario. I'm wondering if this should go in addons.js Please fix the mentioned nits. I'll land this after the merge on both default and mozilla-aurora ::: tests/remote/restartTests/testInstallAddonWithoutEULA/test1.js @@ +59,5 @@ > }); > > // Verify the add-on is installed > var addon = addonsManager.getAddons({attribute: "name", value: ADDON.name})[0]; > + assert.waitFor( function () { nit: extra space @@ +60,5 @@ > > // Verify the add-on is installed > var addon = addonsManager.getAddons({attribute: "name", value: ADDON.name})[0]; > + assert.waitFor( function () { > + return addonsManager.isAddonInstalled({addon: addon}) nit: missing ;
Attachment #823375 - Flags: review?(andrei.eftimie)
Attachment #823375 - Flags: review?(andreea.matei)
Attachment #823375 - Flags: review-
Attached patch waitForAMO_v1.patch (obsolete) — Splinter Review
Fixed a couple of nits. Sorry about those.
Attachment #823375 - Attachment is obsolete: true
Attachment #823384 - Flags: review?(andrei.eftimie)
Attachment #823384 - Flags: review?(andreea.matei)
Flags: needinfo?(mario.garbi)
Comment on attachment 823384 [details] [diff] [review] waitForAMO_v1.patch Review of attachment 823384 [details] [diff] [review]: ----------------------------------------------------------------- If you haven't seen my comment, I don't understand why we need this.
Attachment #823384 - Flags: review?(andrei.eftimie)
Attachment #823384 - Flags: review?(andreea.matei)
Attachment #823384 - Flags: review-
Sorry Henrik, I missed your comment there. Basically after we install the addon we open the AMO Extensions tab and check that the addon is present there. This was handled with assert.ok without waiting for any element and worked fine for all machines. For some reasons the new win-8-32-4 and win-8-64-4 machines performed the install much faster than the rest and checked the Extensions tab without waiting to be populated. By using waitFor we can actually see a few "false" values and then a "true" one which indicates a delay there. I checked if this fixes it on the failing win-8-64-4 machine and we stopped reproducing the issue.
(In reply to mario garbi from comment #8) > Sorry Henrik, I missed your comment there. Basically after we install the > addon we open the AMO Extensions tab and check that the addon is present > there. This was handled with assert.ok without waiting for any element and > worked fine for all machines. Which AMO extensions tab? This test doesn't touch addons.mozilla.org at all. I think you mean AOM instead. Please be careful with acronyms and use the right ones if you want to stop confusion. > For some reasons the new win-8-32-4 and win-8-64-4 machines performed the > install much faster than the rest and checked the Extensions tab without > waiting to be populated. By using waitFor we can actually see a few "false" > values and then a "true" one which indicates a delay there. > I checked if this fixes it on the failing win-8-64-4 machine and we stopped > reproducing the issue. I don't see why this should need an additional waitFor call here. The category change should be done once all extensions and their data have been added tot he view. But not earlier. If that is the case here I assume something else is broken here. So no, I'm against this workaround which is like an additional sleep call.
Hmm, lets backtrack a bit. From what I saw, the code in question: > addonsManager.isAddonInstalled({addon: addon}); Initially returns false That method checks the following DOM attributes: > return addon.getNode().getAttribute("remote") == "false" && > addon.getNode().getAttribute("status") == "installed"; That's why I liked the simple proposal to exchange the ok() check with a waitFor() check. Maybe we should wait in addons.js when we fetch an element (addon) untill it is fully loaded / DOM fully initialised. **** As a sidenote: With the move on multiple sides to make Firefox asynchronous I am expecting to see more waitFor() calls needed in the future. Our current architecture is singleThreaded / blocking and we have to workaround async calls in the newer API's
What type of add-on is it? Given that the test is under restartTests I feel its not a restartless one, right? So after a restart the add-on should always be installed. 'remote'==true would mean it's not locally available.
The test is indeed under restartTests but we only have a single test file as there was no need to actually restart the browser (the installed addon shows in addon manager). We use indeed a remote addon (Nightly Tools) as that was part of the test requirements. I will continue to looked over what happens here but as far as I can tell visually on the new machines we either get the extensions populated slower or we move faster (the test itself is moving very fast over that part).
Attached patch skip.patch (obsolete) — Splinter Review
Adding a skip patch until we come with an acceptable fix patch due to the large number of failures.
Attachment #823961 - Flags: review?(andrei.eftimie)
Attachment #823961 - Flags: review?(andreea.matei)
Comment on attachment 823961 [details] [diff] [review] skip.patch Review of attachment 823961 [details] [diff] [review]: ----------------------------------------------------------------- I miss a proper commit message here, please add it. For the "skip-if" in the manifest, I think it's "win" for windows. Please check against Mozmill 2.0.
Attachment #823961 - Flags: review?(andrei.eftimie)
Attachment #823961 - Flags: review?(andreea.matei)
Attachment #823961 - Flags: review-
Attached patch skip_v1.patch (obsolete) — Splinter Review
Added a commit message and fixed the manifest so we correctly skip it if the OS is windows.
Attachment #823961 - Attachment is obsolete: true
I have set dumps to better show what happens inside the failing method and we can see that while on Linux we get right values right away on mm-win-7-64-4 machine (where it fails) we need a few moments to install the addon as it's status is showing "installing". This will return a false value for isAddonInstalled() if we simply call it without waiting for the addon to finish installing. Linux dumps: TEST-START | /home/mariogarbi/repo/mine/skip/tests/remote/restartTests/testInstallAddonWithoutEULA/test1.js | testInstallAddonWithEULA Remote: false Status: installed TEST-PASS | /home/mariogarbi/repo/mine/skip/tests/remote/restartTests/testInstallAddonWithoutEULA/test1.js | test1.js::testInstallAddonWithEULA mm-win-7-64-4 dumps: TEST-START | c:\jenkins\workspace\mozilla-central_remote\mozmill-tests\tests\remote\restartTests\testInstallAddonWithoutEULA\test1.js | testInstallAddonWithEULA ---- WaitFor iteration --- Remote:false Status:installing ---- WaitFor iteration --- Remote:false Status:installing ---- WaitFor iteration --- Remote:false Status:installed TEST-PASS | c:\jenkins\workspace\mozilla-central_remote\mozmill-tests\tests\remote\restartTests\testInstallAddonWithoutEULA\test1.js | test1.js::testInstallAddonWithEULA
Attachment #823979 - Flags: review?(andrei.eftimie)
Attachment #823979 - Flags: review?(andreea.matei)
Comment on attachment 823979 [details] [diff] [review] skip_v1.patch Review of attachment 823979 [details] [diff] [review]: ----------------------------------------------------------------- So some things here: * Please rename the test so it really follows our naming conventions! It needs a testAddons_ prefix * Why aren't we restarting the browser for testing that the add-on has been installed? That's the reason why your test is failing. You can't fully test this in a single test given that NTT is not a restartless add-on!
Attachment #823979 - Flags: review?(andrei.eftimie)
Attachment #823979 - Flags: review?(andreea.matei)
Attachment #823979 - Flags: review-
Attached patch addonWithoutEulaFix.patch (obsolete) — Splinter Review
Thank you Henrik for catching that, I should have created two tests in the first place. With this patch I've split the test into two tests and changed the name to match the naming convention. As far as I could tell it also fixes the failures as by the time we restart the browser the addon is present in addons manager. http://mozmill-crowd.blargon7.com/#/remote/report/8a42e4b8f277f9c0268b061eb8bcd84a
Attachment #824636 - Flags: review?(andrei.eftimie)
Attachment #824636 - Flags: review?(andreea.matei)
Attachment #823384 - Attachment is obsolete: true
Attachment #823979 - Attachment is obsolete: true
Comment on attachment 824636 [details] [diff] [review] addonWithoutEulaFix.patch Review of attachment 824636 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, only 1 small change needed. ::: tests/remote/restartTests/testAddons_InstallAddonWithoutEULA/test1.js @@ +22,5 @@ > + aModule.addonsManager = new addons.AddonsManager(aModule.controller); > + > + tabs.closeAllTabs(aModule.controller); > + > + persisted.addonName = ADDON.name; Please save the whole ADDON object, not just the name.
Attachment #824636 - Flags: review?(andrei.eftimie)
Attachment #824636 - Flags: review?(andreea.matei)
Attachment #824636 - Flags: review-
Thanks Andrei for catching that, I changed it in this patch as you requested.
Attachment #824636 - Attachment is obsolete: true
Attachment #825781 - Flags: review?(andrei.eftimie)
Attachment #825781 - Flags: review?(andreea.matei)
Comment on attachment 825781 [details] [diff] [review] addonWithoutEulaFix_v1.patch Review of attachment 825781 [details] [diff] [review]: ----------------------------------------------------------------- Landed: http://hg.mozilla.org/qa/mozmill-tests/rev/3dcc21f152e7 (default)
Attachment #825781 - Flags: review?(andrei.eftimie)
Attachment #825781 - Flags: review?(andreea.matei)
Attachment #825781 - Flags: review+
Attachment #825781 - Flags: checkin+
I think we need to get this in mozilla-aurora as well
For consistency also regarding the test name we should probably get this backported to all the branches it exists on.
> For consistency also regarding the test name we should probably get this backported to all > the branches it exists on. The test is new, it exists only on Aurora and Nightly No reason to wait here. All tests are passing on Aurora as well. Transplanted: http://hg.mozilla.org/qa/mozmill-tests/rev/fcfcedd44496 (mozilla-aurora)
Status: ASSIGNED → RESOLVED
Closed: 12 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

Creator:
Created:
Updated:
Size: