mochitest should attempt to close open tabs when failing to obtain focus
Categories
(Testing :: Mochitest, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: bc, Unassigned)
Details
Attachments
(1 obsolete file)
When the browser is unable to focus the main test window, mochitest will issue the following error:
INFO Error: Unable to restore focus, expect failures and timeouts.
I have found during inspection of test runs that this condition can occur if a tab has been left open and selected.
We can help the situation when we hit this condition if we:
- select the main tab
- close all other tabs
- issue a test failure on the currently running test.
#1 and #2 will help prevent the test run from stalling or causing failures in subsequent tests while #3 would help in identifying and fixing problematic tests.
Reporter | ||
Comment 1•6 years ago
|
||
arai: I was wondering if you could help guide me on how to approach this?
Comment 2•6 years ago
|
||
- select the main tab
- close all other tabs
afaik, TestRunner.js is running in tab content, and has no direct access to tabs.
so we should add SpecialPowers API [1] for those steps I think.
(there may be other ways that I'm not aware of tho, I don't know much about mochitest env)
- issue a test failure on the currently running test.
TestRunner._makeIframe
[2] fails on the other test than the problematic test, so, it should remember the previous test's URL to report,
that I think could be stored in the global variable.
Also, given the problematic test doesn't finish properly, the subsequent tests may run with non-clean environment (prefs etc), so the warning about the failure should still be shown.
let me know if there's anything unclear.
[1] https://searchfox.org/mozilla-central/source/testing/specialpowers/content/specialpowersAPI.js
[2] https://searchfox.org/mozilla-central/rev/cc280c4be94ff8cf64a27cc9b3d6831ffa49fa45/testing/mochitest/tests/SimpleTest/TestRunner.js#304
Reporter | ||
Comment 3•6 years ago
|
||
I'm not likely to look at this any time soon.
Updated•5 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
Description
•