Closed Bug 849642 Opened 11 years ago Closed 9 years ago

Intermittent test_networkstats_enabled_perm.html | navigator.mozNetworkStats should be a nsIDOMMozNetworkStatsManager object

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox38 --- wontfix
firefox38.0.5 --- fixed
firefox39 --- fixed
firefox40 --- fixed
firefox41 --- fixed
firefox-esr31 --- wontfix
firefox-esr38 --- fixed
b2g-v2.0 --- fixed
b2g-v2.0M --- fixed
b2g-v2.1 --- fixed
b2g-v2.1S --- fixed
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: philor, Assigned: albert)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 2 obsolete files)

https://tbpl.mozilla.org/php/getParsedLog.php?id=20482072&tree=Mozilla-Inbound
b2g_ics_armv7a_gecko_emulator_vm mozilla-inbound opt test mochitest-1 on 2013-03-08 22:26:26 PST for push e38c5c346840
slave: tst-linux64-ec2-327

23:20:45     INFO -  3813 INFO TEST-PASS | /tests/dom/network/tests/test_networkstats_enabled_perm.html | navigator.mozNetworkStats should exist
23:20:45     INFO -  3814 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/network/tests/test_networkstats_enabled_perm.html | navigator.mozNetworkStats should be a nsIDOMMozNetworkStatsManager object
23:20:45     INFO -  3815 INFO TEST-END | /tests/dom/network/tests/test_networkstats_enabled_perm.html | finished in 4400ms
Is this still happening?
Any interest in looking at this before I disable this longtime-flaky test?
Flags: needinfo?(alberto.crespellperez)
Attached patch Patch (obsolete) — Splinter Review
Flags: needinfo?(alberto.crespellperez)
Assignee: nobody → alberto.crespellperez
There is a problem with SpecialPowers.addPermission("networkstats-manage", true, document);

While it works when launching tests locally, it fails in tryserver, where the permission is not set and the mozNetworkStats is null and test fails, I guess it is a race condition due to tryserver is slower.

After changing SpecialPowers.addPermission by SpecialPowers.pushPermission problem is fixed. pushPermission allows to pass a listener in order to be notified when permission is set.

With that change, all checks of the test are 'PASS' and SimpleTest.finish() is being called but for some reason the test does not finish and fail due to a timeout.
Attached patch Patch WIP (obsolete) — Splinter Review
Attachment #8600974 - Attachment is obsolete: true
Attached patch PatchSplinter Review
Removed removePermision, it was causing the timeout.
Attachment #8606153 - Attachment is obsolete: true
Attachment #8606534 - Flags: review?(ettseng)
Comment on attachment 8606534 [details] [diff] [review]
Patch

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

Albert, thanks for fixing this issue!

The comment of pushPermissions() in specialpowersAPI.js [1] explains why:
/* apply permissions to the system and when the test case is finished (SimpleTest.finish())
   we will revert the permission back to the original. */

Thus, you are right. We cannot call SpecialPowers.removePermission() if we use SpecialPowers.pushPermissions().


[1] https://dxr.mozilla.org/mozilla-central/source/testing/specialpowers/content/specialpowersAPI.js#755
Attachment #8606534 - Flags: review?(ettseng) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/23611294fcd6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.