Closed Bug 1113601 Opened 10 years ago Closed 6 years ago

Intermittent keypad_test.js | Dialer > Keypad "before each" hook

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: cbook, Unassigned)

References

()

Details

(Keywords: intermittent-failure)

b2g_ubuntu64_vm mozilla-inbound opt test gaia-js-integration-1

https://treeherder.mozilla.org/logviewer.html#?job_id=4799734&repo=mozilla-inbound

01:38:30 INFO - TEST-UNEXPECTED-FAIL | apps/communications/dialer/test/marionette/keypad_test.js | Dialer > Keypad "before each" hook
01:38:30 INFO - Error: timeout of 60000ms exceeded
01:38:30 INFO - at null.<anonymous> (/builds/slave/test/gaia/node_modules/mocha/lib/runnable.js:139:19)
01:38:30 INFO - at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
01:38:30 INFO - TEST-UNEXPECTED-FAIL | apps/communications/dialer/test/marionette/keypad_test.js | Dialer > Keypad "after each" hook
01:38:30 INFO - Error: Not connected. To write data you must call connect first.
01:38:30 INFO - at TcpSync.send (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/drivers/tcp-sync.js:152:15)
01:38:30 INFO - at Object.send (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:457:36)
01:38:30 INFO - at Object.Client._sendCommand (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:503:19)
01:38:30 INFO - at Object.closeDriver (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:751:14)
01:38:30 INFO - at Object.executeHook (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:359:20)
01:38:30 INFO - at Object.Client.runHook (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:377:7)
01:38:30 INFO - at Object.destroySession [as deleteSession] (/builds/slave/test/gaia/node_modules/marionette-client/lib/marionette/client.js:761:12)
01:38:30 INFO - at Context.<anonymous> (/builds/slave/test/gaia/node_modules/marionette-js-runner/lib/runtime/hostmanager.js:102:14)
01:38:30 INFO - at Hook.Runnable.run (/builds/slave/test/gaia/node_modules/mocha/lib/runnable.js:196:15)
01:38:30 INFO - at next (/builds/slave/test/gaia/node_modules/mocha/lib/runner.js:258:10)
01:38:30 INFO - at Object._onImmediate (/builds/slave/test/gaia/node_modules/mocha/lib/runner.js:275:5)
01:38:30 INFO - at processImmediate [as _immediateCallback] (timers.js:330:15)
I had a brief look at this and it seems to me that the issue here might be caused by the keypad lazy-loading the suggestion bar during it's init() call. There's nothing in the code waiting for the code to be loaded and the suggestion bar is then registering an event-listener with the keypad itself so this might be causing races at initialization time.
It seems to happen a lot lately.
I just had another look and I was wrong about the lazy-loading part since we're using the lazy loader mock and not really loading the suggestion bar. I've noticed another issue though, we're mocking the gaia sim picker web component in the suiteSetup() only once after having initialized the keypad. This should be done per-test though and we should avoid double-initializations if possible. I'll try to fix that and see if it solves the problem.
Ugh, I've just realized another thing: the init() code is registering event handlers with this notorious pattern:

foo.addEventListener('event', this.onThisDoThat().bind(this));

This is leaking event listeners left and right every time we call KeypadManager.init() as the DOM is initialized only once and the elements are never thrown away between the tests. I'll need to modernize this whole chunk of code to fix this. This might also be causing the issue as a leaked event listener might be invoked after the end of a test; I've seen this happen in the past a few times.
OK, this seems to be getting out of hand, I'll definitely have a look on Monday.
Closing all intermittent test failures for Firefox OS (since we're not focusing on it anymore).

Please reopen if my search included your bug by mistake.
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.