Stop modifying self.expectations in TestExpectationLine.expected_behavior.
authorMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Nov 2017 21:11:10 +0000 (21:11 +0000)
committerMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Nov 2017 21:11:10 +0000 (21:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180074

Reviewed by Simon Fraser.

In particular, getting the property multiple times on a skipped test
expectation line (which happens when using
`Tools/Scripts/run-webkit-tests --print-expectations` if a directory
containing multiple tests is skipped) would yield [pass, skip], then
[pass, skip, skip], then [pass, skip, skip, skip], and so on.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationLine.expected_behavior): copy self.expectations before modifying it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

index 93e08c3..c62a0a7 100644 (file)
@@ -1,3 +1,19 @@
+2017-11-28  Ms2ger  <Ms2ger@igalia.com>
+
+        Stop modifying self.expectations in TestExpectationLine.expected_behavior.
+        https://bugs.webkit.org/show_bug.cgi?id=180074
+
+        Reviewed by Simon Fraser.
+
+        In particular, getting the property multiple times on a skipped test
+        expectation line (which happens when using
+        `Tools/Scripts/run-webkit-tests --print-expectations` if a directory
+        containing multiple tests is skipped) would yield [pass, skip], then
+        [pass, skip, skip], then [pass, skip, skip, skip], and so on.
+
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectationLine.expected_behavior): copy self.expectations before modifying it.
+
 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
index d18249f..e89b2fa 100644 (file)
@@ -411,7 +411,7 @@ class TestExpectationLine(object):
 
     @property
     def expected_behavior(self):
-        expectations = self.expectations
+        expectations = self.expectations[:]
         if "SLOW" in self.modifiers:
             expectations += ["SLOW"]