Closed Bug 958689 Opened 10 years ago Closed 9 years ago

Intermittent test_networkstats_alarms.html | uncaught exception - TypeError: navigator.mozNetworkStats is null | test_networkstats_enabled_no_perm.html | Accessing navigator.mozNetworkStats.getAvailableNetworks should have thrown! | Got an exception

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(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)

RESOLVED FIXED
2.2 S13 (29may)
Tracking Status
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: RyanVM, Assigned: albert)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 2 obsolete files)

https://tbpl.mozilla.org/php/getParsedLog.php?id=32829622&tree=Mozilla-Inbound

b2g_emulator_vm mozilla-inbound opt test mochitest-4 on 2014-01-10 09:25:41 PST for push d3e7f6392670
slave: tst-linux64-spot-463

09:45:10     INFO -  12599 INFO TEST-START | /tests/dom/network/tests/test_networkstats_alarms.html
09:45:10     INFO -  12600 INFO TEST-PASS | /tests/dom/network/tests/test_networkstats_alarms.html | Checking if no alarms are set.
09:45:10     INFO -  12601 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/network/tests/test_networkstats_alarms.html | uncaught exception - TypeError: navigator.mozNetworkStats is null at http://mochi.test:8888/tests/dom/network/tests/test_networkstats_alarms.html:19
09:45:10     INFO -  JavaScript error: http://mochi.test:8888/tests/dom/network/tests/test_networkstats_alarms.html, line 19: navigator.mozNetworkStats is null
09:45:10     INFO -  12602 INFO TEST-INFO | MEMORY STAT vsize after test: 97308672
09:45:10     INFO -  12603 INFO TEST-INFO | MEMORY STAT residentFast after test: 44376064
09:45:10     INFO -  12604 INFO TEST-INFO | MEMORY STAT heapAllocated after test: 16942672
09:45:10     INFO -  12605 INFO TEST-END | /tests/dom/network/tests/test_networkstats_alarms.html | finished in 1043ms
09:45:10     INFO -  12606 INFO TEST-START | /tests/dom/network/tests/test_networkstats_disabled.html
09:45:10     INFO -  12607 INFO TEST-PASS | /tests/dom/network/tests/test_networkstats_disabled.html | navigator.mozNetworkStats should exist
09:45:10     INFO -  12608 INFO TEST-PASS | /tests/dom/network/tests/test_networkstats_disabled.html | mozNetworkStats should be null when not enabled.
09:45:10     INFO -  12609 INFO TEST-INFO | MEMORY STAT vsize after test: 97308672
09:45:10     INFO -  12610 INFO TEST-INFO | MEMORY STAT residentFast after test: 44814336
09:45:10     INFO -  12611 INFO TEST-INFO | MEMORY STAT heapAllocated after test: 17291832
09:45:10     INFO -  12612 INFO TEST-END | /tests/dom/network/tests/test_networkstats_disabled.html | finished in 892ms
09:45:10     INFO -  12613 INFO TEST-START | /tests/dom/network/tests/test_networkstats_enabled_no_perm.html
09:45:10     INFO -  12614 INFO TEST-PASS | /tests/dom/network/tests/test_networkstats_enabled_no_perm.html | navigator.mozNetworkStats should be accessible if dom.mozNetworkStats.enabled is true
09:45:10     INFO -  12615 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/network/tests/test_networkstats_enabled_no_perm.html | Accessing navigator.mozNetworkStats.getAvailableNetworks should have thrown!
09:45:10     INFO -  12616 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/network/tests/test_networkstats_enabled_no_perm.html | Got an exception accessing navigator.mozNetworkStats.getAvailableNetworks
09:45:10     INFO -  12617 INFO TEST-INFO | MEMORY STAT vsize after test: 98357248
09:45:10     INFO -  12618 INFO TEST-INFO | MEMORY STAT residentFast after test: 46604288
09:45:10     INFO -  12619 INFO TEST-INFO | MEMORY STAT heapAllocated after test: 17804472
09:45:10     INFO -  12620 INFO TEST-END | /tests/dom/network/tests/test_networkstats_enabled_no_perm.html | finished in 1021ms
Blocks: 946065
Attached patch Patch (obsolete) — Splinter Review
Attachment #8430687 - Flags: review?(acperez)
Attachment #8430687 - Flags: review?(acperez) → review+
Hi Gene, two months ago I tried to reproduce it with emulator but no luck, so I wanted to wait for bug 986837 to see if it fixes the problem but seems that it persist. Let's see if your debug traces can help.

Thanks!
(In reply to Albert [:albert] from comment #157)
> Hi Gene, two months ago I tried to reproduce it with emulator but no luck,
> so I wanted to wait for bug 986837 to see if it fixes the problem but seems
> that it persist. Let's see if your debug traces can help.

Yeap... I cannot reproduce it on the emulator either. I think the only chance to make mozNetworkStats null is either preference or permission.

Before landing this to find out the root cause, I'd like to confirm one thing with Ryan first. It seems the TBPL Robot just leaves an *empty* comment on the bug (e.g. comment #161). How can it point to the new build failure log? I'm asking this is because we hope to check the dumps we're going to add to figure out what the root cause is.

Hi Ryan, do you know how? Or we have to find it out by ourselves when the TBPL Robot reports a bug?
Flags: needinfo?(ryanvm)
TBPLbot comments are collapsed by default, but you can click the [+] to expand them individually. Or you can click "Expand TinderboxPushlog Comments" next to comment 0 to expand them all.
Flags: needinfo?(ryanvm)
Oh! I saw that. Thanks for the tips!
Attached patch Patch, V2 (obsolete) — Splinter Review
After some thoughts, I think it's better to modify the test cases to find out the root cause instead of dumping something in the code base which will directly affect the product.

In the patch, I'd like to figure out if the preference or permission setting is problematic.

Full try: https://tbpl.mozilla.org/?tree=Try&rev=c7f546a22426
Attachment #8430687 - Attachment is obsolete: true
Attachment #8436832 - Flags: review?(acperez)
Attachment #8436832 - Flags: review?(acperez) → review+
This is patch is aimed to dump more logs to figure out the root cause of the intermittent test errors. We haven't really solved this issue yet, so please leave it open. Thanks!

https://hg.mozilla.org/integration/b2g-inbound/rev/f401165440c5
Keywords: leave-open
Comment #177 is still the log before landing the testing patch (comment #174). Will keep an eye on the new log when the patch applies.
Time to disable this test I think. Obviously a fix isn't going to forthcoming.
Flags: needinfo?(alberto.crespellperez)
I've not been able to reproduce, always green in my laptop. There is something strange, because I don't see traces added by Gene in tbpl logs. I passed tests with mercurial master and inbound..

Maybe we should disable the test only for emulator.
Flags: needinfo?(alberto.crespellperez)
Disabled on B2G. FWIW, they were already disabled on !gonk, so now they're disabled across the board.
https://hg.mozilla.org/integration/b2g-inbound/rev/5e5a3668dbb7
Keywords: leave-open
Whiteboard: [test disabled on B2G][leave open]
Worth trying a similar fix here as bug 849642? Note that this test was disabled awhile ago, so you'll need to re-enable it for any Try pushes you run.
Flags: needinfo?(alberto.crespellperez)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #392)
> Worth trying a similar fix here as bug 849642? Note that this test was
> disabled awhile ago, so you'll need to re-enable it for any Try pushes you
> run.

Yes, I am aware. I guess both bugs are related. As I have seen the problem is that mozNetworkStats property is defined in navigator but its value is null for some reason that I don't know yet. As I can't reproduce it locally I have to deal with try in order to find the root cause, so it is a slow 'debugging' process.
Flags: needinfo?(alberto.crespellperez)
Assignee: nobody → alberto.crespellperez
Attached patch PatchSplinter Review
Same fix of bug 849642
Attachment #8436832 - Attachment is obsolete: true
Attachment #8606619 - Flags: review?(ettseng)
Comment on attachment 8606619 [details] [diff] [review]
Patch

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

Thanks for fixing this.

My comment is the same as https://bugzilla.mozilla.org/show_bug.cgi?id=849642#c420.

::: dom/network/tests/test_networkstats_enabled_no_perm.html
@@ +18,5 @@
> +  SpecialPowers.pushPrefEnv({"set": [['dom.mozNetworkStats.enabled', true]]},
> +                            function() {
> +    SpecialPowers.pushPermissions([{ 'type': 'networkstats-manage', 'allow': 0, 'context': window.document }], runTest);
> +  });
> +

It seems the original code was wrong -- runTest() should not call removePermission() at all because it does not call addPermission().
Anyway, just make sure we have to invoke pushPermissions() here. :)
Attachment #8606619 - Flags: review?(ettseng) → review+
(In reply to Ethan Tseng [:ethan] from comment #398)
> Comment on attachment 8606619 [details] [diff] [review]
> Patch
> 
> Review of attachment 8606619 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Thanks for fixing this.
> 
> My comment is the same as
> https://bugzilla.mozilla.org/show_bug.cgi?id=849642#c420.
> 
> ::: dom/network/tests/test_networkstats_enabled_no_perm.html
> @@ +18,5 @@
> > +  SpecialPowers.pushPrefEnv({"set": [['dom.mozNetworkStats.enabled', true]]},
> > +                            function() {
> > +    SpecialPowers.pushPermissions([{ 'type': 'networkstats-manage', 'allow': 0, 'context': window.document }], runTest);
> > +  });
> > +
> 
> It seems the original code was wrong -- runTest() should not call
> removePermission() at all because it does not call addPermission().
> Anyway, just make sure we have to invoke pushPermissions() here. :)

This test checks stuff when networkstats is enabled and we don't have 'networkstats' permission, that's the reason why I was calling removePermission() without calling addPermission(). permission is now removed calling pushPermissions() with allow = 0.
Keywords: checkin-needed
(In reply to Albert [:albert] from comment #399)
Thanks for your explanation. :)
Finally we resolve this intermittent failure issue. Yeah!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [test disabled on B2G][leave open]
Target Milestone: --- → 2.2 S13 (29may)
You need to log in before you can comment on or make changes to this bug.