Title: [227460] trunk/Tools
Revision
227460
Author
rn...@webkit.org
Date
2018-01-23 16:30:06 -0800 (Tue, 23 Jan 2018)

Log Message

Mac Sierra perf bots have been failing due to CG errors
https://bugs.webkit.org/show_bug.cgi?id=181955

Reviewed by Antti Koivisto.

Ignore the CoreGraphics error messages on macOS Sierra.

Also added tests for ignoring lines in stdout and stderr.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest.run_failed): Refactored for clarity.
(PerfTest):
(PerfTest.filter_ignored_lines): Added.
(PerfTest._lines_to_ignore): Renamed from _lines_to_ignore_in_parser_result since these regular expressions
are now used to ignore lines in other kinds of tests than parser tests.
(PerfTest._errors_to_ignore_in_sierra): Added.
(PerfTest._filter_output): Added the code to ignore errors only on macOS Sierra.
* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(test_parse_output_with_ignored_stdout): Added.
(test_parse_output_with_ignored_stderr): Added.
(test_parse_output_with_ignored_stderr.MockPortWithSierraName): Added.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (227459 => 227460)


--- trunk/Tools/ChangeLog	2018-01-23 23:53:04 UTC (rev 227459)
+++ trunk/Tools/ChangeLog	2018-01-24 00:30:06 UTC (rev 227460)
@@ -1,3 +1,27 @@
+2018-01-22  Ryosuke Niwa  <rn...@webkit.org>
+
+        Mac Sierra perf bots have been failing due to CG errors
+        https://bugs.webkit.org/show_bug.cgi?id=181955
+
+        Reviewed by Antti Koivisto.
+
+        Ignore the CoreGraphics error messages on macOS Sierra.
+
+        Also added tests for ignoring lines in stdout and stderr.
+
+        * Scripts/webkitpy/performance_tests/perftest.py:
+        (PerfTest.run_failed): Refactored for clarity.
+        (PerfTest):
+        (PerfTest.filter_ignored_lines): Added.
+        (PerfTest._lines_to_ignore): Renamed from _lines_to_ignore_in_parser_result since these regular expressions
+        are now used to ignore lines in other kinds of tests than parser tests.
+        (PerfTest._errors_to_ignore_in_sierra): Added.
+        (PerfTest._filter_output): Added the code to ignore errors only on macOS Sierra.
+        * Scripts/webkitpy/performance_tests/perftest_unittest.py:
+        (test_parse_output_with_ignored_stdout): Added.
+        (test_parse_output_with_ignored_stderr): Added.
+        (test_parse_output_with_ignored_stderr.MockPortWithSierraName): Added.
+
 2018-01-23  Eric Carlson  <eric.carl...@apple.com>
 
         Resign NowPlaying status when no media element is eligible

Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftest.py (227459 => 227460)


--- trunk/Tools/Scripts/webkitpy/performance_tests/perftest.py	2018-01-23 23:53:04 UTC (rev 227459)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftest.py	2018-01-24 00:30:06 UTC (rev 227460)
@@ -218,8 +218,10 @@
         return driver.run_test(DriverInput(test_path, time_out_ms, image_hash=None, should_run_pixel_test=should_run_pixel_test), stop_when_done=False)
 
     def run_failed(self, output):
-        if output.text == None or output.error:
+        if output.text == None:
             pass
+        elif output.error:
+            _log.error('error: %s\n%s' % (self.test_name(), output.error))
         elif output.timeout:
             _log.error('timeout: %s' % self.test_name())
         elif output.crash:
@@ -227,9 +229,6 @@
         else:
             return False
 
-        if output.error:
-            _log.error('error: %s\n%s' % (self.test_name(), output.error))
-
         return True
 
     @staticmethod
@@ -241,7 +240,13 @@
                 return True
         return False
 
-    _lines_to_ignore_in_parser_result = [
+    @staticmethod
+    def filter_ignored_lines(regexps, text):
+        lines = re.split('\n', text)
+        filtered_lines = [line for line in lines if not PerfTest._should_ignore_line(regexps, line)]
+        return '\n'.join(filtered_lines)
+
+    _lines_to_ignore = [
         re.compile("^\s+$"),
         # Following are for handle existing test like Dromaeo
         re.compile(re.escape("""main frame - has 1 onunload handler(s)""")),
@@ -257,9 +262,17 @@
         re.compile(r'CONSOLE MESSAGE: line \d+: DEBUG: jQuery\s+: (\d\.)+'),
     ]
 
+    _errors_to_ignore_in_sierra = [
+        # GC errors on macOS 10.12.6
+        re.compile(r'WebKitTestRunner\[\d+\] <Error>: CGContext\w+: invalid context 0x0\. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.'),
+    ]
+
     def _filter_output(self, output):
         if output.text:
-            output.text = '\n'.join([line for line in re.split('\n', output.text) if not self._should_ignore_line(self._lines_to_ignore_in_parser_result, line)])
+            output.text = self.filter_ignored_lines(self._lines_to_ignore, output.text)
+        if output.error:
+            if self._port.name().startswith('mac-sierra'):
+                output.error = self.filter_ignored_lines(self._errors_to_ignore_in_sierra, output.error)
 
 
 class SingleProcessPerfTest(PerfTest):

Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py (227459 => 227460)


--- trunk/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py	2018-01-23 23:53:04 UTC (rev 227459)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py	2018-01-24 00:30:06 UTC (rev 227460)
@@ -115,6 +115,50 @@
 median= 1101.0 ms, stdev= 13.3140211016 ms, min= 1080.0 ms, max= 1120.0 ms
 """)
 
+    def test_parse_output_with_ignored_stdout(self):
+        output = DriverOutput("""
+main frame - has 1 onunload handler(s)
+:Time -> [1080, 1120, 1095, 1101, 1104] ms
+""", image=None, image_hash=None, audio=None)
+        output_capture = OutputCapture()
+        output_capture.capture_output()
+        try:
+            test = PerfTest(MockPort(), 'some-test', '/path/some-dir/some-test')
+            self._assert_results_are_correct(test, output)
+        finally:
+            actual_stdout, actual_stderr, actual_logs = output_capture.restore_output()
+        self.assertEqual(actual_stdout, '')
+        self.assertEqual(actual_stderr, '')
+        self.assertEqual(actual_logs, """RESULT some-test: Time= 1100.0 ms
+median= 1101.0 ms, stdev= 13.3140211016 ms, min= 1080.0 ms, max= 1120.0 ms
+""")
+
+    def test_parse_output_with_ignored_stderr(self):
+        output = DriverOutput(":Time -> [1080, 1120, 1095, 1101, 1104] ms", image=None, image_hash=None, audio=None, error="""
+Jan 22 14:09:24  WebKitTestRunner[1296] <Error>: CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
+Jan 22 14:09:24  WebKitTestRunner[1296] <Error>: CGContextSetStrokeColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
+Jan 22 14:09:24  WebKitTestRunner[1296] <Error>: CGContextGetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
+Jan 22 14:09:24  WebKitTestRunner[1296] <Error>: CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
+Jan 22 14:09:24  WebKitTestRunner[1296] <Error>: CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
+""")
+
+        class MockPortWithSierraName(MockPort):
+            def name(self):
+                return "mac-sierra"
+
+        output_capture = OutputCapture()
+        output_capture.capture_output()
+        try:
+            test = PerfTest(MockPortWithSierraName(), 'some-test', '/path/some-dir/some-test')
+            self._assert_results_are_correct(test, output)
+        finally:
+            actual_stdout, actual_stderr, actual_logs = output_capture.restore_output()
+        self.assertEqual(actual_stdout, '')
+        self.assertEqual(actual_stderr, '')
+        self.assertEqual(actual_logs, """RESULT some-test: Time= 1100.0 ms
+median= 1101.0 ms, stdev= 13.3140211016 ms, min= 1080.0 ms, max= 1120.0 ms
+""")
+
     def _assert_failed_on_line(self, output_text, expected_log):
         output = DriverOutput(output_text, image=None, image_hash=None, audio=None)
         output_capture = OutputCapture()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to