Bug 1558948 - Ignore mtime cache if it's corrupt, r=gsnedders
authorJames Graham <james@hoppipolla.co.uk>
Thu, 13 Jun 2019 10:13:42 +0000
changeset 479110 1fabebb93947f6d501e7ee5566f7226c8a1993d9
parent 479109 2af46ed2e59b9aab02bda25eebd5c610ef373e02
child 479111 9890048a9f4ed06aeca614f55c7b2075f1938bba
push id36169
push usercbrindusan@mozilla.com
push dateTue, 18 Jun 2019 21:46:19 +0000
treeherdermozilla-central@0dff9f803849 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsnedders
bugs1558948
milestone69.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 1558948 - Ignore mtime cache if it's corrupt, r=gsnedders Differential Revision: https://phabricator.services.mozilla.com/D34773
testing/web-platform/tests/tools/manifest/vcs.py
--- a/testing/web-platform/tests/tools/manifest/vcs.py
+++ b/testing/web-platform/tests/tools/manifest/vcs.py
@@ -122,17 +122,20 @@ class CacheFile(object):
         with open(self.path, 'w') as f:
             json.dump(self.data, f, indent=1)
 
     def load(self, rebuild=False):
         data = {}
         try:
             if not rebuild:
                 with open(self.path, 'r') as f:
-                    data = json.load(f)
+                    try:
+                        data = json.load(f)
+                    except ValueError:
+                        pass
                 data = self.check_valid(data)
         except IOError:
             pass
         return data
 
     def check_valid(self, data):
         """Check if the cached data is valid and return an updated copy of the
         cache containing only data that can be used."""