[v8] py3 migration of tools/predictable_wrapper.py

Migrate predictable_wrapper to py3. Run test in v8_presubmit.

R=liviurau@chromium.org, machenbach@chromium.org

Bug: chromium:1245634
Change-Id: I941e248ffcf12ce26a55a5f5889dab06ee74e66e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3448379
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79200}
This commit is contained in:
Alexander Schulze 2022-02-21 21:37:31 +00:00 committed by V8 LUCI CQ
parent 17536f94d6
commit 7601854ddd
4 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@ -31,10 +31,16 @@ TIMEOUT = 120
# Predictable mode works only when run on the host os.
command.setup(utils.GuessOS(), None)
def maybe_decode(message):
if not isinstance(message, str):
return message.decode()
return message
def main(args):
def allocation_str(stdout):
for line in reversed((stdout or '').splitlines()):
if line.startswith('### Allocations = '):
if maybe_decode(line).startswith('### Allocations = '):
return line
return None

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

View File

@ -743,6 +743,7 @@ def PyTests(workspace):
for script in [
join(workspace, 'tools', 'clusterfuzz', 'foozzie', 'v8_foozzie_test.py'),
join(workspace, 'tools', 'release', 'test_scripts.py'),
join(workspace, 'tools', 'unittests', 'predictable_wrapper_test.py'),
join(workspace, 'tools', 'unittests', 'run_tests_test.py'),
join(workspace, 'tools', 'unittests', 'run_perf_test.py'),
join(workspace, 'tools', 'testrunner', 'testproc', 'variant_unittest.py'),