Closed Bug 802312 Opened 7 years ago Closed 7 years ago

test_power_basics.html is failing on b2g mochitest

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

()

Details

Attachments

(1 file, 2 obsolete files)

This test is failing because 
SpecialPowers.addPermission("power", true, document);
only works after the document gets reloaded.
Attached patch patch (obsolete) — Splinter Review
This makes this mochitest pass on b2g emulator.
Attachment #671990 - Flags: review?(kchen)
Assignee: nobody → martijn.martijn
Attached patch patch (obsolete) — Splinter Review
Now with comment that explains.
Attachment #671990 - Attachment is obsolete: true
Attachment #671990 - Flags: review?(kchen)
Attachment #672008 - Flags: review?(kchen)
Attachment #672008 - Flags: review?(kchen) → review+
Keywords: checkin-needed
Martijn, can you please edit your hgrc so that the commit information is in the patch? It makes life easier for those checking in on your behalf. Thanks!
https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/b9892a0403e4 (mostly because we've been closed for a while and I didn't want to push an untested but certain to work if I didn't typo it fix into a freshly reopened tree).

You got a bunch of "ReferenceError: startTest is not defined" and timeout failures, because even though our mochitest boilerplate really encourages you to do it, you do not want to start a test off by using the onload of an empty iframe to call a function which you define below it in the file, because nobody promises you that the script will be evaluated and the function will be defined before the onload fires. Either do what you would automatically do as a matter of course if you were writing a web page, and put the script in the head instead of the body, or just put the iframe below the script it calls into, and you should be fine, though a "try: -b do -p win32 -u mochitest-3 -t none" run (those being the slowest things, which failed you the mostest) first wouldn't hurt.
Attached patch patchSplinter Review
(In reply to Ryan VanderMeulen from comment #3)
> Martijn, can you please edit your hgrc so that the commit information is in
> the patch? It makes life easier for those checking in on your behalf. Thanks!
> https://developer.mozilla.org/en-US/docs/
> Creating_a_patch_that_can_be_checked_in

I'm using a git repository for this, that link didn't explain how to create a correct patch from git. What I found out to use is:
git add dom/power/test/test/test_power_basics.html
git commit -m "Bug 802312 - test_power_basics.html is failing on b2g mochitest, r=kchen" dom/power/test/test/test_power_basics.html
git show HEAD > power.diff

I hope this git patch can be accepted? It's from a git repository, otherwise, I would create a mercurial repository, make the changes there, and make a hg diff there.
Attachment #672008 - Attachment is obsolete: true
Attachment #673684 - Flags: review+
(In reply to Phil Ringnalda (:philor) from comment #5)
> You got a bunch of "ReferenceError: startTest is not defined" and timeout
> failures, because even though our mochitest boilerplate really encourages
> you to do it, you do not want to start a test off by using the onload of an
> empty iframe to call a function which you define below it in the file,
> because nobody promises you that the script will be evaluated and the
> function will be defined before the onload fires. Either do what you would
> automatically do as a matter of course if you were writing a web page, and
> put the script in the head instead of the body, or just put the iframe below
> the script it calls into, and you should be fine, though a "try: -b do -p
> win32 -u mochitest-3 -t none" run (those being the slowest things, which
> failed you the mostest) first wouldn't hurt.

Ok, I changed it that way.
That makes me wonder, though, why a SimpleTest.waitForExplicitFinish() call after a SimpleTest.finish() call would call failures. I guess that is a limitation of the mochitest framework? Or is it deliberate?

I tried to follow the instructions from here, regarding the "try: -b do -p win32 -u mochitest-3 -t none" thing.
https://wiki.mozilla.org/ReleaseEngineering/TryServer#How_to_push_to_try
But that seems limited to hg also.

In my .gitconfig file I added:
[alias]
try = push -f ssh://hg.mozilla.org/try

Would that work?

I don't know of a git version of [paths] in .hgrc. Is there one?

Or I need a git equivalent of:
hg qref --message "try: -b do -p win32 -u mochitest-3 -t none"
hg push -f try
What do I need to use for git?

The mail address that I use for git is my gmail address, but my mozilla hg account is the mozilla.com address. I guess that might be problematic too.
Ok, I've set up mercurial now, and the tryserver settings.
I get: Permission denied (publickey,keyboard-interactive)
for now, though.
I'm working on circumenting that error.

Can anybody else push to try for now?
Try run for 160a0dba3562 is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=160a0dba3562
Results (out of 6 total builds):
    success: 4
    warnings: 2
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/philringnalda@gmail.com-160a0dba3562
The failures are just bustage from mozilla-central, because dougt cannot be trained to push his untested patches to mozilla-inbound instead of mozilla-central.
https://hg.mozilla.org/mozilla-central/rev/029ea0fa93d1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.