Commit af9cb62a authored by Stephen McGruer's avatar Stephen McGruer Committed by Chromium LUCI CQ

[blinkpy] Return to using Python 2 for WPT manifest generation

We are seeing regular hangs on bots when running 'wpt manifest' on
Python 3, which is causing them to go red. Initial investigations have
not been able to locate a root cause (other than the upgrade), so to
stop the bleeding lets switch back to Python 2 for now.

This is not a long-term fix, just a bandaid. WPT is going to Python 3
only in ~Feb 2021, and will start introducing breaking code changes. If
we cannot resolve the issue here, we will end up stuck on old WPT
tooling forever (which is very much not desirable!).

Bug: 1161274
Change-Id: I7cef267d7b4f725a2069950852c75fa4fc009fb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2623816
Auto-Submit: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Luke Z <lpz@chromium.org>
Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842620}
parent f702086e
...@@ -404,8 +404,7 @@ class TestImporter(object): ...@@ -404,8 +404,7 @@ class TestImporter(object):
stages the generated MANIFEST.json in the git index, ready to commit. stages the generated MANIFEST.json in the git index, ready to commit.
""" """
_log.info('Generating MANIFEST.json') _log.info('Generating MANIFEST.json')
WPTManifest.generate_manifest(self.host.port_factory.get(), WPTManifest.generate_manifest(self.host, self.dest_path)
self.dest_path)
manifest_path = self.fs.join(self.dest_path, 'MANIFEST.json') manifest_path = self.fs.join(self.dest_path, 'MANIFEST.json')
assert self.fs.exists(manifest_path) assert self.fs.exists(manifest_path)
manifest_base_path = self.fs.normpath( manifest_base_path = self.fs.normpath(
......
...@@ -25,9 +25,9 @@ from blinkpy.web_tests.port.android import PRODUCTS_TO_EXPECTATION_FILE_PATHS ...@@ -25,9 +25,9 @@ from blinkpy.web_tests.port.android import PRODUCTS_TO_EXPECTATION_FILE_PATHS
MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS MOCK_WEB_TESTS = '/mock-checkout/' + RELATIVE_WEB_TESTS
MANIFEST_INSTALL_CMD = [ MANIFEST_INSTALL_CMD = [
'python3', 'python',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt', '/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'manifest', '-v', '--no-download', '--tests-root', '--py2', 'manifest', '-v', '--no-download', '--tests-root',
MOCK_WEB_TESTS + 'external/wpt' MOCK_WEB_TESTS + 'external/wpt'
] ]
......
...@@ -317,7 +317,7 @@ class WPTManifest(object): ...@@ -317,7 +317,7 @@ class WPTManifest(object):
_log.error('Manifest base not found at "%s".', _log.error('Manifest base not found at "%s".',
base_manifest_path) base_manifest_path)
WPTManifest.generate_manifest(port, wpt_path) WPTManifest.generate_manifest(port.host, wpt_path)
if fs.isfile(manifest_path): if fs.isfile(manifest_path):
_log.debug('Manifest generation completed.') _log.debug('Manifest generation completed.')
...@@ -328,17 +328,17 @@ class WPTManifest(object): ...@@ -328,17 +328,17 @@ class WPTManifest(object):
fs.write_text_file(manifest_path, '{}') fs.write_text_file(manifest_path, '{}')
@staticmethod @staticmethod
def generate_manifest(port, dest_path): def generate_manifest(host, dest_path):
"""Generates MANIFEST.json on the specified directory.""" """Generates MANIFEST.json on the specified directory."""
wpt_exec_path = PathFinder(port.host.filesystem).path_from_blink_tools( wpt_exec_path = PathFinder(host.filesystem).path_from_blink_tools(
'blinkpy', 'third_party', 'wpt', 'wpt', 'wpt') 'blinkpy', 'third_party', 'wpt', 'wpt', 'wpt')
cmd = [ cmd = [
port.python3_command(), wpt_exec_path, 'manifest', '-v', 'python', wpt_exec_path, '--py2', 'manifest', '-v',
'--no-download', '--tests-root', dest_path '--no-download', '--tests-root', dest_path
] ]
# ScriptError will be raised if the command fails. # ScriptError will be raised if the command fails.
output = port.host.executive.run_command( output = host.executive.run_command(
cmd, cmd,
timeout_seconds=600, timeout_seconds=600,
# This will also include stderr in the exception message. # This will also include stderr in the exception message.
......
...@@ -24,8 +24,9 @@ class WPTManifestUnitTest(unittest.TestCase): ...@@ -24,8 +24,9 @@ class WPTManifestUnitTest(unittest.TestCase):
{manifest_path: '{"manifest": "base"}'}) {manifest_path: '{"manifest": "base"}'})
self.assertEqual(host.executive.calls, [[ self.assertEqual(host.executive.calls, [[
'python3', 'python',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt', '/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'--py2',
'manifest', 'manifest',
'-v', '-v',
'--no-download', '--no-download',
...@@ -48,8 +49,9 @@ class WPTManifestUnitTest(unittest.TestCase): ...@@ -48,8 +49,9 @@ class WPTManifestUnitTest(unittest.TestCase):
{manifest_path: '{"manifest": "base"}'}) {manifest_path: '{"manifest": "base"}'})
self.assertEqual(host.executive.calls, [[ self.assertEqual(host.executive.calls, [[
'python3', 'python',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt', '/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'--py2',
'manifest', 'manifest',
'-v', '-v',
'--no-download', '--no-download',
...@@ -70,8 +72,9 @@ class WPTManifestUnitTest(unittest.TestCase): ...@@ -70,8 +72,9 @@ class WPTManifestUnitTest(unittest.TestCase):
port = TestPort(host) port = TestPort(host)
WPTManifest.ensure_manifest(port, 'wpt_internal') WPTManifest.ensure_manifest(port, 'wpt_internal')
self.assertEqual(host.executive.calls, [[ self.assertEqual(host.executive.calls, [[
'python3', 'python',
'/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt', '/mock-checkout/third_party/blink/tools/blinkpy/third_party/wpt/wpt/wpt',
'--py2',
'manifest', 'manifest',
'-v', '-v',
'--no-download', '--no-download',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment