Bug 1452287 [wpt PR 10323] - Handle the case when MANIFEST.json is invalid JSON, a=testonly
authorfergald <fergald@gmail.com>
Mon, 09 Apr 2018 22:13:30 +0000
changeset 413754 60be40ffa07b0af142a7ba59ff366b27199728d1
parent 413753 2b66a5d5300b1a835214f4479bdb28c8fbfdfc08
child 413755 0752e6c384ce8cdcb64732e636d91f4090abf917
push id33850
push userapavel@mozilla.com
push dateMon, 16 Apr 2018 09:53:48 +0000
treeherdermozilla-central@6276ec7ebbf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452287, 10323, 822041
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452287 [wpt PR 10323] - Handle the case when MANIFEST.json is invalid JSON, a=testonly Automatic update from web-platform-testsHandle the case when MANIFEST.json is empty (#10323) I don't know how I got into this situation (probably hit ctrl-C at the wrong time) but I did and it was unclear how to get out. It presents as a ValueError with no useful info. Update the code to handle ValueError to log a warning and cause a full regen of the manifest. Also reported in https://crbug.com/822041 wpt-commits: 384edc99c0e2cac89b0d0c3d405a913fb045bd20 wpt-pr: 10323 wpt-commits: 384edc99c0e2cac89b0d0c3d405a913fb045bd20 wpt-pr: 10323
testing/web-platform/tests/tools/manifest/manifest.py
--- a/testing/web-platform/tests/tools/manifest/manifest.py
+++ b/testing/web-platform/tests/tools/manifest/manifest.py
@@ -220,16 +220,19 @@ def load(tests_root, manifest):
             logger.debug("Opening manifest at %s" % manifest)
         else:
             logger.debug("Creating new manifest at %s" % manifest)
         try:
             with open(manifest) as f:
                 rv = Manifest.from_json(tests_root, json.load(f))
         except IOError:
             return None
+        except ValueError:
+            logger.warning("%r may be corrupted", manifest)
+            return None
         return rv
 
     return Manifest.from_json(tests_root, json.load(manifest))
 
 
 def write(manifest, manifest_path):
     dir_name = os.path.dirname(manifest_path)
     if not os.path.exists(dir_name):