From 79e87dcbaad00490818490ce45ac17fa3c03c462 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 5 Sep 2019 18:54:11 +0000 Subject: [PATCH] Bug 1579168 - Fix updating metadata for results that are expected but have known intermittents, r=maja_zf We were assuming that in the case that the status matched expected we'd have no expected entry in the log data. But actually it was being set to None, so handle both those cases. Differential Revision: https://phabricator.services.mozilla.com/D44874 --HG-- extra : moz-landing-system : lando --- .../tools/wptrunner/wptrunner/metadata.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py index 0a540ca1f7bd..59136552be3c 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py @@ -220,8 +220,10 @@ def pack_result(data): if not data.get("known_intermittent"): return status_intern.store(data.get("status")) result = array.array("B") - result_parts = ([data["status"], data.get("expected", data["status"])] + - data["known_intermittent"]) + expected = data.get("expected") + if expected is None: + expected = data["status"] + result_parts = [data["status"], expected] + data["known_intermittent"] for i, part in enumerate(result_parts): value = status_intern.store(part) if i % 2 == 0: @@ -686,14 +688,6 @@ class TestFileData(object): expected.set_leak_threshold(run_info, value) continue - if prop == "status": - status, known_intermittent = unpack_result(value) - value = Result(status, - known_intermittent, - default_expected_by_type[self.item_type, - subtest_id is not None], - ) - test_expected = expected_by_test[test_id] if subtest_id is None: item_expected = test_expected @@ -701,7 +695,14 @@ class TestFileData(object): if isinstance(subtest_id, str): subtest_id = subtest_id.decode("utf8") item_expected = test_expected.get_subtest(subtest_id) + if prop == "status": + status, known_intermittent = unpack_result(value) + value = Result(status, + known_intermittent, + default_expected_by_type[self.item_type, + subtest_id is not None], + ) item_expected.set_result(run_info, value) elif prop == "asserts": item_expected.set_asserts(run_info, value)