Closed Bug 969583 Opened 10 years ago Closed 10 years ago

Intermittent test_mediarecorder_record_timeslice.html | uncaught exception - InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable | [SimpleTest.finish()] this test already called finish! | called finish() multiple

Categories

(Core :: Audio/Video: Recording, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30
Tracking Status
firefox29 --- wontfix
firefox30 --- fixed
firefox-esr24 --- unaffected
b2g-v1.4 --- fixed

People

(Reporter: RyanVM, Assigned: jwwang)

References

Details

(Keywords: intermittent-failure, regression)

Attachments

(2 files, 1 obsolete file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=34281646&tree=B2g-Inbound

b2g_emulator_vm b2g-inbound opt test mochitest-3 on 2014-02-07 04:21:59 PST for push 793f060868f1
slave: tst-linux64-spot-490

04:58:39     INFO -  1561 INFO TEST-START | /tests/content/media/test/test_mediarecorder_record_timeslice.html
04:58:39     INFO -  1562 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | Started Fri Feb 07 2014 12:58:33 GMT+0000 (UTC) (1391777913.829s)
04:58:39     INFO -  1563 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/test/test_mediarecorder_record_timeslice.html | uncaught exception - InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable at http://mochi.test:8888/tests/content/media/test/test_mediarecorder_record_timeslice.html:89
04:58:39     INFO -  JavaScript error: http://mochi.test:8888/tests/content/media/test/test_mediarecorder_record_timeslice.html, line 89: InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable
04:58:39     INFO -  1564 INFO TEST-INFO | MEMORY STAT vsize after test: 112447488
04:58:39     INFO -  1565 INFO TEST-INFO | MEMORY STAT residentFast after test: 50188288
04:58:39     INFO -  1566 INFO TEST-INFO | MEMORY STAT heapAllocated after test: 20701672
04:58:39     INFO -  1567 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | ondataavailable fired
04:58:39     INFO -  1568 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | ondataavailable fired
04:58:39     INFO -  1569 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | onstop fired
04:58:39     INFO -  1570 INFO TEST-END | /tests/content/media/test/test_mediarecorder_record_timeslice.html | finished in 6942ms
04:58:39     INFO -  1571 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | Finished at Fri Feb 07 2014 12:58:39 GMT+0000 (UTC) (1391777919.653s)
04:58:39     INFO -  1572 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_record_timeslice.html | Running time: 5.824s
04:59:49     INFO -  1573 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/test/test_mediarecorder_record_timeslice.html | [SimpleTest.finish()] this test already called finish!
04:59:49     INFO -  1574 ERROR TEST-UNEXPECTED-FAIL | /tests/content/media/test/test_mediarecorder_record_timeslice.html | called finish() multiple times
Assignee: nobody → rlin
This is failing here:

http://hg.mozilla.org/mozilla-central/file/c71a1f6f6f2f/content/media/test/test_mediarecorder_record_timeslice.html#l89

Which implies that we're likely to trying to record a stream that's already ended. Although technically that shouldn't be possible, as mozCaptureStream was used here, rather than mozCaptureStreamUntilEnded.
Suspected cause of this regression is bug 960243.
Blocks: 960243
Keywords: regression
https://tbpl.mozilla.org/php/getParsedLog.php?id=34468126&tree=Try&full=1

22:00:53     INFO -  9562 INFO TEST-START | /tests/content/media/test/test_mediarecorder_creation_fail_gstreamer2.html
22:00:53     INFO -  9563 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_creation_fail_gstreamer2.html | oncanplaythrough
22:00:53     INFO -  9564 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_creation_fail_gstreamer2.html | oncanplaythrough
22:00:56     INFO -  9565 INFO TEST-INFO | /tests/content/media/test/test_mediarecorder_creation_fail_gstreamer2.html | duration=3.343616, currentTime=3.343672

There is bug in which oncanplaythrough is fired more than once on Linux. test_mediarecorder_record_xxx.html will screw if oncanplaythrough is fired more than once.

Since the failures happened on b2g instead of Linux and it is super-hard to reproduce, I would like to add some logs in the tests to see if multiple oncanplaythrough is also observed on b2g.
Assignee: rlin → jwwang
Status: NEW → ASSIGNED
Attached patch part1_addlog.patch (obsolete) — Splinter Review
Since this bug is hard to reproduce on b2g, I will add some logs to observe if multiple canplaythrought events are received which will screw test_mediarecorder_xxx tests.
Attachment #8373878 - Flags: review?(jsmith)
Comment on attachment 8373878 [details] [diff] [review]
part1_addlog.patch

Clearing review - if I recall, Rob mentioned it was expected that canplaythrough could fire multiple times in these scenarios when I built the getUserMedia mochitests. Can't remember the reason why.

Rob - Is it expected that canplaythrough could fire multiple times here?
Attachment #8373878 - Flags: review?(jsmith)
Flags: needinfo?(roc)
Generally canplaythrough can fire more than once. The spec is quite clear on this. The readyState can change to HAVE_ENOUGH_DATA, and then changing load speeds or buffering constraints can cause the readyState to change back down to HAVE_FUTURE_DATA, and then change back to HAVE_ENOUGH_DATA, in which case canplaythrough will fire again.
Flags: needinfo?(roc)
(In reply to JW Wang[:jwwang] from comment #6)
> test_mediarecorder_record_xxx.html will screw if oncanplaythrough is fired
> more than once.

Can you change the test to remove the canplaythrough listener inside the canplaythrough listener, so that the listener only runs once?
(In reply to Chris Pearce (:cpearce) from comment #10)
> (In reply to JW Wang[:jwwang] from comment #6)
> > test_mediarecorder_record_xxx.html will screw if oncanplaythrough is fired
> > more than once.
> 
> Can you change the test to remove the canplaythrough listener inside the
> canplaythrough listener, so that the listener only runs once?

Sure, that is a good idea. I am working on that.
Attached patch part1_fix.patchSplinter Review
As commented in comment #9, canplaythrough can fire more than once which will then screw the tests. We will remove the listener inside the canplaythrough listener as suggested by :cpearce.
Attachment #8373878 - Attachment is obsolete: true
Attachment #8374590 - Flags: review?(cpearce)
Attachment #8374590 - Flags: review?(cpearce) → review+
Comment on attachment 8374590 [details] [diff] [review]
part1_fix.patch

I think you missed one test to update here:

* test_mediarecorder_record_immediate_stop.html
Attachment #8374590 - Flags: review-
Comment on attachment 8374590 [details] [diff] [review]
part1_fix.patch

Actually disregard - that test already took the canplaythrough event behavior into account.
Attachment #8374590 - Flags: review-
(In reply to JW Wang[:jwwang] from comment #12)
> Created attachment 8374590 [details] [diff] [review]
> part1_fix.patch
> 
> As commented in comment #9, canplaythrough can fire more than once which
> will then screw the tests. We will remove the listener inside the
> canplaythrough listener as suggested by :cpearce.

try: https://tbpl.mozilla.org/?tree=Try&rev=0b2e6d1308c7
Hi Ryan,
Please check in part1_fix.patch and leave this bug open. Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/integration/b2g-inbound/rev/ff1cf4f665ff

For future reference, you can just put [leave open] on the whiteboard when you want a bug left open after a patch lands. :)
Keywords: checkin-needed
Whiteboard: [leave open]
Component: Video/Audio → Video/Audio: Recording
No longer blocks: MediaRecording
No failures since the fix landed here, so closing this out.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: