Bug 1452913 - Prevent hang of reftests when reading test objects list fails. draft
authorHenrik Skupin <mail@hskupin.info>
Tue, 10 Apr 2018 14:20:02 +0200
changeset 779727 a7fa2a9ec79c45ec5894712fa11f2725cd5d8a76
parent 779456 1b91e11c60912e9d1e944645dbff0d522cd6ac8c
push id105838
push userbmo:hskupin@gmail.com
push dateTue, 10 Apr 2018 12:20:39 +0000
bugs1452913
milestone61.0a1
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
layout/tools/reftest/reftest.jsm
--- 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);