Bug 1452913 - Prevent hang of reftests when reading test objects list fails. r=gbrown a=test-only
authorHenrik Skupin <mail@hskupin.info>
Tue, 10 Apr 2018 14:20:02 +0200
changeset 463173 2906b68565838730bbcab48ba59f89c6f9810527
parent 463172 5b7aa80c261963293a7f59a5845f67d85ab1c6cd
child 463174 7f00cb049e35d0cefc3bd0b6a1a6150501812a15
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown, test-only
bugs1452913
milestone60.0
Bug 1452913 - Prevent hang of reftests when reading test objects list fails. r=gbrown a=test-only 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
@@ -368,16 +368,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);