Closed Bug 1016504 Opened 10 years ago Closed 10 years ago

Intermittent system/test/unit/bootstrap_test.js | system/Bootstrap "after all" hook | TypeError: navigator.mozL10n is undefined (http://system.gaiamobile.org:8080/js/internet_sharing.js?time=XXX)

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: RyanVM, Assigned: julienw)

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

46 bytes, text/x-github-pull-request
alive
: review+
Details | Review
https://tbpl.mozilla.org/php/getParsedLog.php?id=40464601&tree=Mozilla-Inbound

b2g_ubuntu64_vm mozilla-inbound opt test gaia-unit on 2014-05-27 09:07:00 PDT for push ca0fc67da7cb
slave: tst-linux64-spot-354

09:41:55     INFO -  gaia-unit-tests TEST-START | system/test/unit/bootstrap_test.js | check for insane devices beeing cancelled
09:41:55     INFO -  gaia-unit-tests TEST-PASS  | system/test/unit/bootstrap_test.js | system/Bootstrap check for insane devices beeing cancelled mousedown should be preventDefaulted
09:41:55     INFO -  gaia-unit-tests TEST-PASS  | system/test/unit/bootstrap_test.js | system/Bootstrap check for insane devices beeing cancelled mouseup should be preventDefaulted
09:41:55     INFO -  gaia-unit-tests TEST-PASS  | system/test/unit/bootstrap_test.js | system/Bootstrap check for insane devices beeing cancelled touchend should be preventDefaulted
09:41:55     INFO -  gaia-unit-tests TEST-PASS  | system/test/unit/bootstrap_test.js | system/Bootstrap check for insane devices beeing cancelled touchend should be preventDefaulted
09:41:55     INFO -  gaia-unit-tests TEST-END   | system/test/unit/bootstrap_test.js | check for insane devices beeing cancelled
09:41:55     INFO -  JavaScript error: http://system.gaiamobile.org:8080/js/internet_sharing.js?time=1401208914254, line 142: navigator.mozL10n is undefined
09:41:55     INFO -  gaia-unit-tests TEST-END   | system/test/unit/bootstrap_test.js | system/Bootstrap
09:41:55     INFO -  gaia-unit-tests TEST-UNEXPECTED-FAIL | system/test/unit/bootstrap_test.js | system/Bootstrap "after all" hook | TypeError: navigator.mozL10n is undefined (http://system.gaiamobile.org:8080/js/internet_sharing.js?time=1401208914254:142)
09:41:55     INFO -  gaia-unit-tests INFO       | stack trace:
09:41:55     INFO -      Error: TypeError: navigator.mozL10n is undefined (http://system.gaiamobile.org:8080/js/internet_sharing.js?time=1401208914254:142)
09:41:55     INFO -          at onerror (http://system.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4959:7)
09:41:55     INFO -  gaia-unit-tests INFO       | suite results (pass/fail): 6/1
09:41:55     INFO -  gaia-unit-tests TEST-END   | system/test/unit/secure_window_test.js |
09:41:55     INFO -  gaia-unit-tests INFO       | suite results (pass/fail): 6/1
09:41:55     INFO -  JavaScript error: http://test-agent.gaiamobile.org:8080/common/vendor/test-agent/test-agent.js, line 1246: NS_ERROR_NOT_CONNECTED:
09:41:55     INFO -  gaia-unit-tests WARNING    | Build shut down unexpectedly
09:41:55     INFO -  checking for crashes
09:41:56    ERROR - Return code: 1
Stas, this seems like something up your alley.
Flags: needinfo?(stas)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #65)
> Stas, this seems like something up your alley.

Yep, I've also seen this when working on bug 1000895.  The bustage fix for that bug should help fix this issue.  I should have a patch tomorrow morning.
Flags: needinfo?(stas)
(In reply to Staś Małolepszy :stas from comment #68)
> (In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #65)
> > Stas, this seems like something up your alley.
> 
> Yep, I've also seen this when working on bug 1000895.  The bustage fix for
> that bug should help fix this issue.  I should have a patch tomorrow morning.

It seems that it didn't fix the issue. Do you plan to work on that or would you like me to take it over?
Yesterday I tried to reproduce at least once locally using https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/Gaia_unit_tests#Running_tests_like_TBPL_does but to no avail.  I'm working on this this morning.
The errors is this assignment here:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/apps/system/js/internet_sharing.js#L142

It's in internetSharingSettingsChangeHanlder (sic) which is called when the 'tethering.{usb,wifi}.enabled' settings change.  They most likely change here:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/apps/system/js/internet_sharing.js#L102

which might be in turn triggered by one of the branches here:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/apps/system/js/internet_sharing.js#L109-L132

The "after all" hook in bootstrap_test.js is rather uneventful:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/apps/system/test/unit/bootstrap_test.js#L105-L119

I don't think the order matters.

I also suspect that one of the mocks registered here:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/apps/system/test/unit/bootstrap_test.js#L49-L58

could be doing something weird in its mSuiteTeardown method, which would also show up as 'system/Bootstrap "after all" hook' in the log.  These methods are called by the MocksHelper here:

https://github.com/mozilla-b2g/gaia/blob/8b7ecdfbd5bca2cad1e46dd2f9b0bafa74adf931/shared/test/unit/mocks/mocks_helper.js#L63
I'm still not sure what causes these intermittent failures, but I cleaned up the code a little bit in the following pull request:

https://github.com/mozilla-b2g/gaia/pull/20285

https://travis-ci.org/mozilla-b2g/gaia/builds/27209518
https://tbpl.mozilla.org/?tree=Gaia-Try&rev=567cdfe88097
Kevin, this seems to be related to Internet Sharing and the settings listeners it registers. Can you help me debug this?
Flags: needinfo?(kgrandon)
Hmm, not really sure what's going on here, but it seems like something async is getting fired after we restore the mocks?

I wonder if we can simply include l10n.js inside the test instead of mock_l10n to see if the problem would go away? What do you think?
Flags: needinfo?(kgrandon)
Or maybe you can try to find what's async? Sinon's fake timers could help?
Attached file github PR
Found an obvious issue in the test, so here is a first tentative
Comment on attachment 8440525 [details] [review]
github PR

Gaia Try looks very green:

https://tbpl.mozilla.org/?tree=Gaia-Try&rev=0c14fb9415615feeeacd5a88f339abfd6f28a9ec

Tell me if you'd like that I run the tests a little more.
Attachment #8440525 - Flags: review?(alive)
Assignee: nobody → felash
Attachment #8440525 - Flags: review?(alive) → review+
master: 336c30b6147cdd9122ad0b2bbffb81eb869a9ec2

let's see if it reproduces after this.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
a=tests
v2.0: e09233a715fa8ba5f458e72d736661ea10b35830
^ this is not the same failure.

Can we file a separate bug?
Flags: needinfo?(emorley)
Sure :-)

Saw it was different, but didn't know if it was fallout from the PR.
Flags: needinfo?(emorley)
Thanks ! :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: