Closed Bug 1080556 Opened 10 years ago Closed 10 years ago

Intermittent bluetooth/test/unit/transfer_test.js | Bluetooth app > transfer handle "share" activity > observes settings key "bluetooth.enabled" - MockNavigatorSettings.mObservers[bluetoothKey] is undefined

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: RyanVM, Assigned: julienw)

References

Details

(Keywords: intermittent-failure, regression)

Attachments

(1 file)

46 bytes, text/x-github-pull-request
stas
: review+
Details | Review
https://treeherder.mozilla.org/ui/logviewer.html#?job_id=610621&repo=b2g-inbound

builder 	b2g_ubuntu64_vm b2g-inbound opt test gaia-unit
buildid 	20141008203809
builduid 	14669853bfb24007bdd5796c2aac9fa6
results 	warnings (1)
revision 	7e241bac644a
slave 		tst-linux64-spot-1130
starttime 	Thu Oct 09 2014 00:00:45 GMT-0400 (Eastern Standard Time)

21:30:17 INFO - TEST-START | bluetooth/test/unit/transfer_test.js
21:30:17 INFO - TEST-UNEXPECTED-FAIL | bluetooth/test/unit/transfer_test.js | Bluetooth app > transfer handle "share" activity > observes settings key "bluetooth.enabled" - MockNavigatorSettings.mObservers[bluetoothKey] is undefined
21:30:17 INFO - TypeError: MockNavigatorSettings.mObservers[bluetoothKey] is undefined
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/test/unit/transfer_test.js:95:7)
21:30:17 INFO - at wrapper (app://bluetooth.gaiamobile.org/common/test/mocha_generators.js:62:19)
21:30:17 INFO - at run (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3709:7)
21:30:17 INFO - at runTest (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:4081:5)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:4127:7)
21:30:17 INFO - at next (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:4007:1)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:4016:7)
21:30:17 INFO - at next (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3964:1)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3979:7)
21:30:17 INFO - at done (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3700:5)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3712:9)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/test/mocha_generators.js:46:20)
21:30:17 INFO - at wrapper (app://bluetooth.gaiamobile.org/common/test/mocha_generators.js:73:15)
21:30:17 INFO - at run (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3709:7)
21:30:17 INFO - at next (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3973:5)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:3984:5)
21:30:17 INFO - at (anonymous) (app://bluetooth.gaiamobile.org/common/vendor/mocha/mocha.js:4932:28)
21:30:17 INFO - TEST-PASS | bluetooth/test/unit/transfer_test.js | Bluetooth app > transfer handle "share" activity > confirme dialog is showing after Bluetooth is disabled
21:30:17 INFO - TEST-OK | bluetooth/test/unit/transfer_test.js | took 127ms
I think what likely happens is that the "once" function in the mock for mozL10n has not run yet when "setup" executes. As a result the "trigger" call in "setup" do nothing, and the tested code do not run.
Maybe an easy fix is to stub navigator.mozL10n.once to call the callback asap instead of using setTimeout.
(In reply to Julien Wajsberg [:julienw] from comment #12)
> Maybe an easy fix is to stub navigator.mozL10n.once to call the callback
> asap instead of using setTimeout.

Caused by bug 1043643?
Flags: needinfo?(stas)
Note that I think we should not _generally_ do this, but only in this test file.
Component: Bluetooth → Gaia::Bluetooth File Transfer
Attached file github PR
Let's see how it looks like on gaia try.
Assignee: nobody → felash
Comment on attachment 8507503 [details] [review]
github PR

Looks not intermittent anymore :)
Attachment #8507503 - Flags: review?(timdream)
Attachment #8507503 - Flags: review?(timdream) → review?(stas)
Comment on attachment 8507503 [details] [review]
github PR

I missed this last week due to a workweek, sorry.  LGTM, r=me, thanks Julien!
Flags: needinfo?(stas)
Attachment #8507503 - Flags: review?(stas) → review+
master: c77a28dc8a497cc38319d0b22c77c0aada2a4534

thanks!
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: