Bug 859065 - Avoid "command timed out: 1200 seconds without output, attempting to kill" by providing an inner xpcshell timeout of 5 minutes. r=jmaher

This commit is contained in:
Paolo Amadini 2013-04-16 20:35:09 +02:00
parent f876d23659
commit 5659218182

View File

@ -10,6 +10,8 @@
* for more information.
*/
const _XPCSHELL_TIMEOUT_MS = 5 * 60 * 1000;
var _quit = false;
var _passed = true;
var _tests_pending = 0;
@ -315,6 +317,15 @@ function _execute_test() {
// Call do_get_idle() to restore the factory and get the service.
_fakeIdleService.activate();
// Terminate asynchronous tests when a global timeout occurs.
do_timeout(_XPCSHELL_TIMEOUT_MS, function _do_main_timeout() {
try {
do_throw("test timed out");
} catch (e if e == Components.results.NS_ERROR_ABORT) {
// We don't want do_timeout to report the do_throw exception again.
}
});
// _HEAD_FILES is dynamically defined by <runxpcshelltests.py>.
_load_files(_HEAD_FILES);
// _TEST_FILE is dynamically defined by <runxpcshelltests.py>.