Bug 1476053 - Handle invalid json in metadata updates, r=ato
Sometimes we get errors that result in invalid json in the logs.
There's nothing reasonable to do about this during metadata updates
so just skip it
MozReview-Commit-ID: 4QuM7M3lXGv
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
@@ -245,17 +245,21 @@ class ExpectedUpdater(object):
return
log_file.seek(0)
self.update_from_raw_log(log_file)
def update_from_raw_log(self, log_file):
action_map = self.action_map
for line in log_file:
- data = json.loads(line)
+ try:
+ data = json.loads(line)
+ except ValueError:
+ # Just skip lines that aren't json
+ continue
action = data["action"]
if action in action_map:
action_map[action](data)
def update_from_wptreport_log(self, data):
action_map = self.action_map
action_map["suite_start"]({"run_info": data["run_info"]})
for test in data["results"]: