Bug 1579168 - Fix updating metadata for results that are expected but have known intermittents, r=maja_zf
authorJames Graham <james@hoppipolla.co.uk>
Thu, 05 Sep 2019 18:54:11 +0000
changeset 491901 4fe3084ae3e4ce4f20ebf6c0cf333381ac93a0c8
parent 491900 710a9eb7511711b1d037371fabc535bc09735eae
child 491902 51eed6df0a9df36b312540fec89abeaebb787fae
push id114036
push usernerli@mozilla.com
push dateFri, 06 Sep 2019 09:46:47 +0000
treeherdermozilla-inbound@18c10d385d35 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1579168
milestone71.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 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
testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
@@ -215,18 +215,20 @@ status_intern = InternedData(4)
 
 
 def pack_result(data):
     # As `status_intern` normally handles one status, if `known_intermittent` is present in
     # the test logs, intern and store this with the `status` in an array until needed.
     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:
             assert value < 16
             result.append(value << 4)
         else:
             result[-1] += value
     return result
@@ -681,32 +683,31 @@ class TestFileData(object):
                         if prop == "lsan":
                             expected.set_lsan(run_info, value)
                         elif prop == "leak-object":
                             expected.set_leak_object(run_info, value)
                         elif prop == "leak-threshold":
                             expected.set_leak_threshold(run_info, value)
                         continue
 
+                    test_expected = expected_by_test[test_id]
+                    if subtest_id is None:
+                        item_expected = test_expected
+                    else:
+                        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],
                         )
-
-                    test_expected = expected_by_test[test_id]
-                    if subtest_id is None:
-                        item_expected = test_expected
-                    else:
-                        if isinstance(subtest_id, str):
-                            subtest_id = subtest_id.decode("utf8")
-                        item_expected = test_expected.get_subtest(subtest_id)
-                    if prop == "status":
                         item_expected.set_result(run_info, value)
                     elif prop == "asserts":
                         item_expected.set_asserts(run_info, value)
 
         expected.update(full_update=full_update,
                         disable_intermittent=disable_intermittent)
         for test in expected.iterchildren():
             for subtest in test.iterchildren():