Hash :
da864294
Author :
Date :
2024-07-18T18:44:55
Capture/Replay: rework capture_replay_tests, enable linux-trace Changing the way capture_replay_tests orders its stages. Previously, build, capture and replay would all run concurrently in multiple processes sometimes causing difficult to understand interaction between those stages. This CL changes it so that the test follows stages sequentially: * Build end2end tests * Run all capture tests (in parallel) * Check captured files and produce a single build for replay * Build replay binary and all tests * Run all replay tests (in parallel, but _one by one_) Note that running replay tests one by one avoids the confusing batch failures altogether. Now when a replay test is broken, the logs will specifically identify which one caused the issue. This also noticeably improves CI time as ninja builds of bigger batches are more efficient and possibly less linking is happening. Additionally, xvfb is supported directly in the script without relying on testing/xvfb.py, in a way that reuses xvfb displays instead of starting/stopping xvfb for each test and avoids races that are possible when running testing/xvfb.py concurrently (such as picking which display to use). This appears to significantly improve stability on linux-trace which have had to be disabled due to the flakiness. Bug: angleproject:42264614 Change-Id: I38a5547250cf5f63b8b9e4879f02cd715d8df0a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5721996 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
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
# Copyright 2020 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("../../../gni/angle.gni")
import("../angle_traces.gni")
declare_args() {
# Determines if we build the capture_replay_tests. Off by default.
angle_build_capture_replay_tests = false
# Set the trace directory. Default is traces
angle_capture_replay_test_trace_dir = "traces"
angle_capture_replay_composite_file_id = 1
}
if (angle_build_capture_replay_tests) {
assert(angle_with_capture_by_default, "Must build with capture by default.")
_test_names_file = "test_names_${angle_capture_replay_composite_file_id}.json"
angle_trace_libs("angle_capture_replay_libs") {
_tracedir = angle_capture_replay_test_trace_dir
trace_dir = _tracedir
json_path = "$_tracedir/$_test_names_file"
_trace_json = read_file(json_path, "json")
trace_list = _trace_json.traces
short_names = true
}
}
angle_executable("capture_replay_tests") {
testonly = true
sources = [ "CaptureReplayTests.cpp" ]
deps = [
"$angle_root:angle_compression",
"$angle_root/util:angle_frame_capture_test_utils",
"$angle_root/util:angle_trace_loader",
"$angle_root/util:angle_util",
]
data_deps = [
"$angle_root:libEGL",
"$angle_root:libGLESv2",
]
configs += [
"$angle_root:library_name_config",
"${angle_root}:libANGLE_config",
]
defines = []
if ((is_linux || is_chromeos) && !is_component_build) {
# Set rpath to find shared libs in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
# Disable optimization to avoid optimizing huge files.
_trace_folder_relative_path = "./" + angle_capture_replay_test_trace_dir
_data_path = rebase_path(_trace_folder_relative_path, root_out_dir)
defines = [
"ANGLE_CAPTURE_REPLAY_TEST_DATA_DIR=\"${_data_path}\"",
"ANGLE_REPLAY_EXPORT=",
]
include_dirs = [ "." ]
if (angle_build_capture_replay_tests) {
deps += [ ":angle_capture_replay_libs" ]
}
}