Closed Bug 760199 Opened 12 years ago Closed 12 years ago

test_incoming.js: TEST-UNEXPECTED-FAIL | got false, expected true

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jgriffin, Assigned: vicamo)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

This is one of the Marionette sms WebAPI tests for B2G.  On the last 10 runs of this test, 9 have failed with:

test_incoming.js
TEST-UNEXPECTED-FAIL | Traceback (most recent call last):
File "/data/jenkins/jobs/webapi-marionette-test/workspace/testing/marionette/client/marionette/marionette_test.py", line 194, in runTest
'%d tests failed:\n%s' % (results['failed'], '\n'.join(fails)))
AssertionError: 1 tests failed:
TEST-UNEXPECTED-FAIL | got false, expected true

This is the only failure on the WebAPI CI at present.

The logcat for this test is:

I/Gecko   (   41): MARIONETTE LOG: INFO: Sent fake SMS: OK
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined - OK should equal OK
I/Gecko   (   41): MARIONETTE LOG: INFO: Received an SMS!
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined - received should equal received
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined - 5555552368 should equal 5555552368
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined - null should equal null
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined - Hello SMS world! should equal Hello SMS world!
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-PASS | undefined
I/Gecko   (   41): MARIONETTE TEST RESULT:TEST-UNEXPECTED-FAIL | undefined
Component: DOM → DOM: Device Interfaces
QA Contact: general → device-interfaces
The specific test assertion which is apparently failing, given the log above, is:

  ok(message.timestamp.getTime() > now);
(In reply to Jonathan Griffin (:jgriffin) from comment #1)
> The specific test assertion which is apparently failing, given the log
> above, is:
> 
>   ok(message.timestamp.getTime() > now);

Interesting. I'll get a patch ready to print the discrepancy of the timestamps. Maybe that'll tell us something. My initial idea was timezones, but both Date.now() and Date.prototype.getTime() should return the timestamp in UTC... mysterious, mysterious.
Mounir, can you please take a look at this failure?  If you don't have enough time, just let me know.  Thanks!
Assignee: nobody → mounir
(In reply to Andrew Overholt [:overholt] from comment #3)
> Mounir, can you please take a look at this failure?  If you don't have
> enough time, just let me know.  Thanks!

As said during the WebAPI meeting this is unlikely relevant to the WebSMS DOM code but likely to the WebSMS Gonk backend: message timestamps is provided by the backend, not the DOM code.
I assigned this to Philipp given that he said in comment 2 that he will have a look.
Assignee: mounir → philipp
Blocks: 438871
Whiteboard: [orange]
A SMS-DELIVER message comes with a timestamp embedded by SMSC and it's the one that we pass to DOM. However, its max accuracy is `seconds`, so here is an example of failure:

> INFO Received an SMS! Thu Aug 16 2012 03:17:05 GMT+0000 (GMT)
> INFO Now : 1345087025303 Thu Aug 16 2012 03:17:05 GMT+0000 (GMT)
> INFO Recv: 1345087025000 Thu Aug 16 2012 03:17:05 GMT+0000 (GMT)
> INFO Sent fake SMS: OK Thu Aug 16 2012 03:17:05 GMT+0000 (GMT)

As you may see, the SMSC timestamp was truncated to 1345087025"000". Thanks to modern CPU power, it is possible that the emulator finishes all the work in a second and therefore results in the test failure in this case.

I'll upload a patch later for this.
Assignee: philipp → vyang
Status: NEW → ASSIGNED
Blocks: 707659
Comment on attachment 652318 [details] [diff] [review]
fix test failure due to SMSC timestamp truncation

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

Nice catch.
Attachment #652318 - Flags: review?(philipp) → review+
https://hg.mozilla.org/mozilla-central/rev/90a5d5cca5fc
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.