Closed Bug 849714 Opened 7 years ago Closed 7 years ago

Intermittent test_outgoing_answer_hangup_oncallschanged.js | got OK, expected outbound to 5555552368 : unknown | got false, expected true, and | got undefined, expected OK | got false, expected true

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla23
Tracking Status
firefox23 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- affected

People

(Reporter: philor, Assigned: rwood)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 1 obsolete file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=20511828&tree=Mozilla-Inbound
b2g_ics_armv7a_gecko_emulator_vm mozilla-inbound opt test marionette-webapi on 2013-03-10 19:57:20 PDT for push cc45fdc389df
slave: tst-linux64-ec2-057

20:06:05     INFO -  TEST-START test_outgoing_answer_hangup_oncallschanged.js
20:06:06     INFO -  /builds/slave/test/build/tests/marionette/tests/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js, runTest (marionette_test.MarionetteJSTestCase) ... FAIL
20:06:06     INFO -  ======================================================================
20:06:06     INFO -  FAIL: /builds/slave/test/build/tests/marionette/tests/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js, runTest (marionette_test.MarionetteJSTestCase)
20:06:06     INFO -  ----------------------------------------------------------------------
20:06:06    ERROR -  Traceback (most recent call last):
20:06:06     INFO -    File "/builds/slave/test/build/tests/marionette/marionette/marionette_test.py", line 228, in runTest
20:06:06     INFO -      '%d tests failed:\n%s' % (results['failed'], '\n'.join(fails)))
20:06:06     INFO -  AssertionError: 2 tests failed:
20:06:06     INFO -  TEST-UNEXPECTED-FAIL | test_outgoing_answer_hangup_oncallschanged.js | got OK, expected outbound to  5555552368 : unknown | got false, expected true
20:06:06     INFO -  TEST-UNEXPECTED-FAIL | test_outgoing_answer_hangup_oncallschanged.js | got undefined, expected OK | got false, expected true
20:06:06     INFO -  START LOG:
20:06:06     INFO -  INFO Call list is now: OK Sun Mar 10 2013 16:05:49 GMT-1100 (SST)
20:06:06     INFO -  INFO TEST-START: /builds/slave/test/build/tests/marionette/tests/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js Sun Mar 10 2013 16:05:49 GMT-1100 (SST)
20:06:06     INFO -  INFO Verifying initial state. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Initial call list: OK Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Make an outgoing call. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Received 'callschanged' call event. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Call list is now: OK Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Answering the outgoing call. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Received 'connected' call event. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Call list is now: outbound to  5555552368 : active,OK Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Hanging up the outgoing call. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  INFO Received 'callschanged' call event. Sun Mar 10 2013 16:05:50 GMT-1100 (SST)
20:06:06     INFO -  END LOG:
20:06:06     INFO -  ----------------------------------------------------------------------
20:06:06     INFO -  Ran 1 test in 1.471s
20:06:06     INFO -  FAILED (failures=1)
It looks like "gsm list" may not be synchronous with gecko's oncallschanged callback, at least for gecko-originated calls.  This seems to make sense; the hardware's call state change may lag gecko's, when gecko is originating the change.

We probably want to take the "gsm list" function at http://mxr.mozilla.org/mozilla-central/source/dom/telephony/test/marionette/test_outgoing_answer_hangup_oncallschanged.js#53 and put it inside a waitFor call, so we can wait for call state to reach our expected state.
Assignee: nobody → rwood
Attached patch Fix intermittent failure (obsolete) — Splinter Review
Patch with the suggested change, thanks Jonathan.
Attachment #740490 - Flags: review?(jgriffin)
Comment on attachment 740490 [details] [diff] [review]
Fix intermittent failure

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

Looking at this code, I realize it won't work well.  The reason is that waitFor calls the second callback every 100ms until it returns true.  Since 'callMade' is being set inside a callback inside a callback, we could end up with dozens or more of emulator commands in the stack, which I guess would cause problems at least intermittently.

I think a better approach is not to use waitFor, and instead do something like:

function checkCallList() {
   runEmulatorCmd("gsm list", function(result) {
      // if the call list is ready, answer the call,
      // else:
      window.setTimeout(checkCallList, 100);
   });
}
checkCallList();

This way, we're not calling runEmulatorCmd again until the last instance has already finished.
Attachment #740490 - Flags: review?(jgriffin) → review-
Ahh right, makes sense. Ok I'll try that, thanks!
Attachment #740490 - Attachment is obsolete: true
Attachment #741381 - Flags: review?(jgriffin)
Comment on attachment 741381 [details] [diff] [review]
Fix intermittent failure

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

Cool, thanks.
Attachment #741381 - Flags: review?(jgriffin) → review+
https://hg.mozilla.org/mozilla-central/rev/6586fb3abbbe
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.