Bug 1452913 - Prevent hang of reftests when reading test objects list fails.
For the promise as returned by "OS.File.read()" the catch handler
is missing, and as such the tests will never be started when
the call to "read()" triggers an exception. It also results in
a hang of the reftest harness.
To prevent this, the failure has to be handled and appropriately
reported.
MozReview-Commit-ID: IX9thgjjahS
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -363,16 +363,19 @@ function ReadTests() {
}
if (testList) {
logger.debug("Reading test objects from: " + testList);
let promise = OS.File.read(testList).then(function onSuccess(array) {
let decoder = new TextDecoder();
g.urls = JSON.parse(decoder.decode(array)).map(CreateUrls);
StartTests();
+ }).catch(function onFailure(e) {
+ logger.error("Failed to load test objects: " + e);
+ DoneTests();
});
} else if (manifests) {
// Parse reftest manifests
// XXX There is a race condition in the manifest parsing code which
// sometimes shows up on Android jsreftests (bug 1416125). It seems
// adding/removing log statements can change its frequency.
logger.debug("Reading " + manifests.length + " manifests");
manifests = JSON.parse(manifests);