Title: [253462] trunk/Tools
Revision
253462
Author
[email protected]
Date
2019-12-12 18:13:30 -0800 (Thu, 12 Dec 2019)

Log Message

Python 3: Support serial webkitpy.common tests
https://bugs.webkit.org/show_bug.cgi?id=205162

Reviewed by Stephanie Lewis.

* Scripts/webkitpy/common/system/executive.py:
(Executive.running_pids): Processess are encoded as bytes.
* Scripts/webkitpy/common/system/executive_unittest.py:
(ExecutiveTest.serial_test_run_in_parallel): Use Python 3 compatible print statements.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (253461 => 253462)


--- trunk/Tools/ChangeLog	2019-12-13 01:57:24 UTC (rev 253461)
+++ trunk/Tools/ChangeLog	2019-12-13 02:13:30 UTC (rev 253462)
@@ -1,3 +1,15 @@
+2019-12-12  Jonathan Bedard  <[email protected]>
+
+        Python 3: Support serial webkitpy.common tests
+        https://bugs.webkit.org/show_bug.cgi?id=205162
+
+        Reviewed by Stephanie Lewis.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.running_pids): Processess are encoded as bytes.
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+        (ExecutiveTest.serial_test_run_in_parallel): Use Python 3 compatible print statements.
+
 2019-12-12  Fujii Hironori  <[email protected]>
 
         webkit-patch print-expectations fails to format TestExpectationLine with DumpJSConsoleLogInStdErr

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive.py (253461 => 253462)


--- trunk/Tools/Scripts/webkitpy/common/system/executive.py	2019-12-13 01:57:24 UTC (rev 253461)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive.py	2019-12-13 02:13:30 UTC (rev 253462)
@@ -305,8 +305,8 @@
                     try:
                         # In some cases the line can contain one or more
                         # leading white-spaces, so strip it before split.
-                        pid, process_name = line.strip().split(' ', 1)
-                        if process_name_filter(process_name):
+                        pid, process_name = line.strip().split(b' ', 1)
+                        if process_name_filter(unicode_compatibility.decode_for(process_name, str)):
                             running_pids.append(int(pid))
                     except ValueError as e:
                         pass

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py (253461 => 253462)


--- trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py	2019-12-13 01:57:24 UTC (rev 253461)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive_unittest.py	2019-12-13 02:13:30 UTC (rev 253462)
@@ -247,7 +247,7 @@
 
         NUM_PROCESSES = 4
         DELAY_SECS = 0.25
-        cmd_line = [sys.executable, '-c', 'import time; time.sleep(%f); print "hello"' % DELAY_SECS]
+        cmd_line = [sys.executable, '-c', 'import time; time.sleep(%f); print("hello")' % DELAY_SECS]
         cwd = os.getcwd()
         commands = [tuple([cmd_line, cwd])] * NUM_PROCESSES
         start = time.time()
@@ -254,7 +254,7 @@
         command_outputs = Executive().run_in_parallel(commands, processes=NUM_PROCESSES)
         done = time.time()
         self.assertTrue(done - start < NUM_PROCESSES * DELAY_SECS)
-        self.assertEqual([output[1] for output in command_outputs], ["hello\n"] * NUM_PROCESSES)
+        self.assertEqual([output[1] for output in command_outputs], [b'hello\n'] * NUM_PROCESSES)
         self.assertEqual([],  multiprocessing.active_children())
 
     def test_run_in_parallel_assert_nonempty(self):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to