Closed Bug 1176038 Opened 6 years ago Closed 2 years ago

Intermittent test_bug1151186.html | Test timed out | called finish() multiple times

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P5)

x86_64
Windows 8
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox41 --- wontfix

People

(Reporter: RyanVM, Assigned: masayuki)

References

()

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Attached image test screenshot
17:14:53 INFO - [Parent 3592] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file c:\builds\moz2_slave\m-aurora-w64-d-000000000000000\build\src\widget\windows\WinUtils.cpp, line 1363
17:16:42 INFO - TEST-INFO | screenshot: exit status 0
17:16:42 INFO - 3488 INFO TEST-UNEXPECTED-FAIL | widget/tests/test_bug1151186.html | Test timed out. - expected PASS
17:16:43 INFO - MEMORY STAT vsize after test: 1868267520
17:16:43 INFO - MEMORY STAT vsizeMaxContiguous after test: 7867650015232
17:16:43 INFO - MEMORY STAT residentFast after test: 483401728
17:16:43 INFO - MEMORY STAT heapAllocated after test: 298337972
17:16:43 INFO - 3489 INFO TEST-OK | widget/tests/test_bug1151186.html | took 308720ms
17:16:43 INFO - 3490 INFO TEST-PASS | widget/tests/test_bug1151186.html | The div element should be focused
17:16:43 INFO - 3491 INFO TEST-PASS | widget/tests/test_bug1151186.html | IME should be enabled
17:16:43 INFO - 3492 ERROR [SimpleTest.finish()] this test already called finish!
17:16:43 INFO - 3493 INFO TEST-UNEXPECTED-ERROR | widget/tests/test_bug1151186.html | called finish() multiple times
> 17:16:43 INFO - 3490 INFO TEST-PASS | widget/tests/test_bug1151186.html | The div element should be focused
> 17:16:43 INFO - 3491 INFO TEST-PASS | widget/tests/test_bug1151186.html | IME should be enabled
> 17:16:43 INFO - 3492 ERROR [SimpleTest.finish()] this test already called finish!

Odd... After test is timed out, the test runs completely. It seems that focus event hasn't been fired by some reason and it's fired at cleaning up the timed out test.

I guess that previous test is changed and it causes this failure...
The test purpose is that it sets focus to the editor during document gets focus. So, we cannot use SimpleTest.waitForFocus() in this test, unfortunately...
This test fails with runByDir enabled on Linux(32 bit) Debug. Here's a link to try : https://treeherder.mozilla.org/#/jobs?repo=try&revision=313ffe0c5721&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-classifiedState=unclassified&filter-searchStr=linux

This can be reproduced by : ./mach mochitest widget/tests

13:29:51     INFO -  4019 INFO TEST-OK | widget/tests/test_bug1151186.html | took 517ms
13:29:51     INFO -  4020 INFO TEST-PASS | widget/tests/test_bug1151186.html | The div element should be focused
13:29:51     INFO -  4021 INFO TEST-PASS | widget/tests/test_bug1151186.html | IME should be enabled
13:29:51     INFO -  4022 ERROR [SimpleTest.finish()] this test already called finish!
13:29:51     INFO -  4023 INFO TEST-UNEXPECTED-ERROR | widget/tests/test_bug1151186.html | called finish() multiple times
Blocks: 1110982
:masayuki, is there a chance we can do something to fix this?  Next week will are planning to turn run-by-dir on for mochitest-chrome debug and this will need to be disabled on linux32 debug.
Flags: needinfo?(masayuki)
I have no idea. As I said, the focus event of the document is required. However, the log indicates that it may not be fired in some cases. I guess that some tests running before this test might have problem causing this.

And if the bug is regressed due to disabling the test, it's too bad since it causes IME unavailable on the rich text editor...

We need some advice for this from some people who know focus problem of mochitests well.
Flags: needinfo?(masayuki)
Neil, can you help us out with this?
Flags: needinfo?(enndeakin)
This has been disabled for linux-debug to get run-by-dir enabled : https://dxr.mozilla.org/mozilla-central/source/widget/tests/chrome.ini#21

This can be tested on the try server and re-enabled once fixed.
Possibly, the test should check if the document is already focused, and call the code inside the focus event listener directly. You could check this with document.hasFocus()
Flags: needinfo?(enndeakin)
Bulk assigning P3 to all open intermittent bugs without a priority set in Firefox components per bug 1298978.
Priority: -- → P3
Priority: P3 → P5
Component: Event Handling → User events and focus handling

(In reply to Neil Deakin from comment #13)

Possibly, the test should check if the document is already focused, and call
the code inside the focus event listener directly. You could check this with
document.hasFocus()

Oh, probably, I didn't realize the reply.

Currently, I'm working on bug 1611360 for fixing similar failure. However, as I've tested for this advice, document.hasFocus() returns true even before the focus event. Therefore, this approach isn't available because it tests IME state change when editor gets focus from focus event listener of the document.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Depends on: 1611360

Should be fixed by bug 1611360 because it guarantees the test runs only once with {once: true} for 3rd argument of addEventListener.

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