Hash :
f2ee319d
Author :
Date :
2024-07-03T07:02:13
Roll Chromium from 51d79108bbb3 to 34f452e68b67 (970 revisions) Due to http://crrev.com/c/5651996: 1. Don't use Xvfb for angle_unittests. 2. Force --use-xvfb in restricted_trace_gold_tests. https://chromium.googlesource.com/chromium/src.git/+log/51d79108bbb3..34f452e68b67 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/chromium-angle-autoroll Please CC abdolrashidi@google.com,angle-team@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Chromium: https://bugs.chromium.org/p/chromium/issues/entry To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Changed dependencies * build: https://chromium.googlesource.com/chromium/src/build.git/+log/feff4a53b0..229704c27a * buildtools: https://chromium.googlesource.com/chromium/src/buildtools.git/+log/2984b8fcc4..819c7ae6e8 * testing: https://chromium.googlesource.com/chromium/src/testing/+log/106f24b1e1..bf1591ad6e * third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/36641ab0e3..e190315d54 * third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/6a00e594c9..ca091f0d16 * third_party/flatbuffers/src: https://chromium.googlesource.com/external/github.com/google/flatbuffers.git/+log/6ede1ccc9e..fb9afbafc7 * third_party/libc++/src: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git/+log/144e2174e9..0312683647 * third_party/zlib: https://chromium.googlesource.com/chromium/src/third_party/zlib/+log/8b7eff801b..68e57e619c * tools/android: https://chromium.googlesource.com/chromium/src/tools/android/+log/66f8276b4e..a05e27145f * tools/clang: https://chromium.googlesource.com/chromium/src/tools/clang.git/+log/7e2aebd75d..303336503e * tools/mb: https://chromium.googlesource.com/chromium/src/tools/mb/+log/7c0882a310..04455f259c * tools/perf: https://chromium.googlesource.com/chromium/src/tools/perf/+log/aaadc0d4ed..04ec6d97b6 No update to Clang. Bug: chromium:40257169 Change-Id: Ibe9a6bd3906df8cedb42f56adfe5085046b68bd2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5673851 Reviewed-by: Solti Ho <solti@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
# Copyright 2022 The ANGLE 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.
import contextlib
import datetime
import fnmatch
import json
import importlib
import io
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import android_helper
import angle_path_util
angle_path_util.AddDepsDirToPath('testing/scripts')
import common
if sys.platform.startswith('linux'):
# vpython3 can handle this on Windows but not python3
import xvfb
ANGLE_TRACE_TEST_SUITE = 'angle_trace_tests'
def Initialize(suite_name):
android_helper.Initialize(suite_name)
# Requires .Initialize() to be called first
def IsAndroid():
return android_helper.IsAndroid()
class LogFormatter(logging.Formatter):
def __init__(self):
logging.Formatter.__init__(self, fmt='%(levelname).1s%(asctime)s %(message)s')
def formatTime(self, record, datefmt=None):
# Drop date as these scripts are short lived
return datetime.datetime.fromtimestamp(record.created).strftime('%H:%M:%S.%fZ')
def SetupLogging(level):
# Reload to reset if it was already setup by a library
importlib.reload(logging)
logger = logging.getLogger()
logger.setLevel(level)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(LogFormatter())
logger.addHandler(handler)
def IsWindows():
return sys.platform == 'cygwin' or sys.platform.startswith('win')
def ExecutablePathInCurrentDir(binary):
if IsWindows():
return '.\\%s.exe' % binary
else:
return './%s' % binary
def HasGtestShardsAndIndex(env):
if 'GTEST_TOTAL_SHARDS' in env and int(env['GTEST_TOTAL_SHARDS']) != 1:
if 'GTEST_SHARD_INDEX' not in env:
logging.error('Sharding params must be specified together.')
sys.exit(1)
return True
return False
def PopGtestShardsAndIndex(env):
return int(env.pop('GTEST_TOTAL_SHARDS')), int(env.pop('GTEST_SHARD_INDEX'))
# Adapted from testing/test_env.py: also notifies current process and restores original handlers.
@contextlib.contextmanager
def forward_signals(procs):
assert all(isinstance(p, subprocess.Popen) for p in procs)
interrupted_event = threading.Event()
def _sig_handler(sig, _):
interrupted_event.set()
for p in procs:
if p.poll() is not None:
continue
# SIGBREAK is defined only for win32.
# pylint: disable=no-member
if sys.platform == 'win32' and sig == signal.SIGBREAK:
p.send_signal(signal.CTRL_BREAK_EVENT)
else:
print("Forwarding signal(%d) to process %d" % (sig, p.pid))
p.send_signal(sig)
# pylint: enable=no-member
if sys.platform == 'win32':
signals = [signal.SIGBREAK] # pylint: disable=no-member
else:
signals = [signal.SIGINT, signal.SIGTERM]
original_handlers = {}
for sig in signals:
original_handlers[sig] = signal.signal(sig, _sig_handler)
yield
for sig, handler in original_handlers.items():
signal.signal(sig, handler)
if interrupted_event.is_set():
raise KeyboardInterrupt()
# From testing/test_env.py, see run_command_with_output below
def _popen(*args, **kwargs):
assert 'creationflags' not in kwargs
if sys.platform == 'win32':
# Necessary for signal handling. See crbug.com/733612#c6.
kwargs['creationflags'] = subprocess.CREATE_NEW_PROCESS_GROUP
return subprocess.Popen(*args, **kwargs)
# Forked from testing/test_env.py to add ability to suppress logging with log=False
def run_command_with_output(argv, stdoutfile, env=None, cwd=None, log=True):
assert stdoutfile
with io.open(stdoutfile, 'wb') as writer, \
io.open(stdoutfile, 'rb') as reader:
process = _popen(argv, env=env, cwd=cwd, stdout=writer, stderr=subprocess.STDOUT)
with forward_signals([process]):
while process.poll() is None:
if log:
sys.stdout.write(reader.read().decode('utf-8'))
# This sleep is needed for signal propagation. See the
# wait_with_signals() docstring.
time.sleep(0.1)
if log:
sys.stdout.write(reader.read().decode('utf-8'))
return process.returncode
def RunTestSuite(test_suite,
cmd_args,
env,
show_test_stdout=True,
use_xvfb=False):
if android_helper.IsAndroid():
result, output, json_results = android_helper.RunTests(
test_suite, cmd_args, log_output=show_test_stdout)
return result, output, json_results
cmd = ExecutablePathInCurrentDir(test_suite) if os.path.exists(
os.path.basename(test_suite)) else test_suite
runner_cmd = [cmd] + cmd_args
logging.debug(' '.join(runner_cmd))
with contextlib.ExitStack() as stack:
stdout_path = stack.enter_context(common.temporary_file())
flag_matches = [a for a in cmd_args if a.startswith('--isolated-script-test-output=')]
if flag_matches:
results_path = flag_matches[0].split('=')[1]
else:
results_path = stack.enter_context(common.temporary_file())
runner_cmd += ['--isolated-script-test-output=%s' % results_path]
if use_xvfb:
# Default changed to '--use-xorg', which fails per http://crbug.com/40257169#comment34
# '--use-xvfb' forces the old working behavior
runner_cmd += ['--use-xvfb']
xvfb_whd = '3120x3120x24' # Max screen dimensions from traces, as per:
# % egrep 'Width|Height' src/tests/restricted_traces/*/*.json | awk '{print $3 $2}' | sort -n
exit_code = xvfb.run_executable(
runner_cmd, env, stdoutfile=stdout_path, xvfb_whd=xvfb_whd)
else:
exit_code = run_command_with_output(
runner_cmd, env=env, stdoutfile=stdout_path, log=show_test_stdout)
with open(stdout_path) as f:
output = f.read()
with open(results_path) as f:
data = f.read()
json_results = json.loads(data) if data else None # --list-tests => empty file
return exit_code, output, json_results
def GetTestsFromOutput(output):
out_lines = output.split('\n')
try:
start = out_lines.index('Tests list:')
end = out_lines.index('End tests list.')
except ValueError as e:
logging.exception(e)
return None
return out_lines[start + 1:end]
def FilterTests(tests, test_filter):
matches = set()
for single_filter in test_filter.split(':'):
matches.update(fnmatch.filter(tests, single_filter))
return sorted(matches)