Commit 6aed2832 by Manh Nguyen Committed by Commit Bot

Batch capture run + change how results are logged

Before, the run stages of tests in a batch were run separately by multiple subprocesses. Now the run stages of tests in a batch are batched together and run by a single subprocess. Changes how results are logged. Tests in a batch are logged together. Within a batch, tests that fail at the same stage are also logged together. Bug: angleproject:4817 Change-Id: Ie3f992c081de914f1f1f521bec2d72f06ccca238 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2331738 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 6c873cfd
......@@ -8,9 +8,6 @@ declare_args() {
# Determines if we build the capture_replay_tests. Off by default.
angle_build_capture_replay_tests = false
# Decide which context to replay, starting with desktop default
angle_capture_replay_test_context_id = 1
# Set the trace directory. Default is traces
angle_capture_replay_test_trace_dir = "traces"
......@@ -24,7 +21,6 @@ if (angle_build_capture_replay_tests) {
"${angle_capture_replay_test_trace_dir}/traces${angle_capture_replay_composite_file_id}.gni")
angle_executable("capture_replay_tests") {
testonly = true
_contextid = angle_capture_replay_test_context_id
_trace_folder_relative_path = "./" + angle_capture_replay_test_trace_dir
_trace_sources =
generated_sources + [
......@@ -54,7 +50,6 @@ if (angle_build_capture_replay_tests) {
_data_path = rebase_path(_trace_folder_relative_path, root_out_dir)
defines = [
"ANGLE_CAPTURE_REPLAY_TEST_DATA_DIR=\"${_data_path}\"",
"ANGLE_CAPTURE_REPLAY_TEST_CONTEXT_ID=${_contextid}",
"ANGLE_CAPTURE_REPLAY_COMPOSITE_TESTS_HEADER=" +
angle_capture_replay_test_trace_dir +
"/CompositeTests${angle_capture_replay_composite_file_id}.h",
......
......@@ -29,22 +29,6 @@
// This will expand to "angle_capture_context<#>.h"
#include ANGLE_MACRO_STRINGIZE(ANGLE_CAPTURE_REPLAY_COMPOSITE_TESTS_HEADER)
// Assign the context numbered functions based on GN arg selecting replay ID
std::function<void(uint32_t)> SetupContextReplay = reinterpret_cast<void (*)(uint32_t)>(
ANGLE_MACRO_CONCAT(SetupContext,
ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_TEST_CONTEXT_ID, Replay)));
std::function<void(uint32_t, uint32_t)> ReplayContextFrame =
reinterpret_cast<void (*)(uint32_t, uint32_t)>(
ANGLE_MACRO_CONCAT(ReplayContext,
ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_TEST_CONTEXT_ID, Frame)));
std::function<void(uint32_t)> ResetContextReplay = reinterpret_cast<void (*)(uint32_t)>(
ANGLE_MACRO_CONCAT(ResetContext,
ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_TEST_CONTEXT_ID, Replay)));
std::function<std::vector<uint8_t>(uint32_t, uint32_t)> GetSerializedContextStateData =
reinterpret_cast<std::vector<uint8_t> (*)(uint32_t, uint32_t)>(
ANGLE_MACRO_CONCAT(GetSerializedContext,
ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_TEST_CONTEXT_ID, StateData)));
const std::string resultTag = "*RESULT";
class CaptureReplayTests
......
......@@ -9,6 +9,9 @@
#include "ANGLETest.h"
#include <algorithm>
#include <cstdlib>
#include "common/platform.h"
#include "gpu_info_util/SystemInfo.h"
#include "util/EGLWindow.h"
......@@ -303,8 +306,9 @@ TestPlatformContext gPlatformContext;
// After a fixed number of iterations we reset the test window. This works around some driver bugs.
constexpr uint32_t kWindowReuseLimit = 50;
constexpr char kUseConfig[] = "--use-config=";
constexpr char kSeparateProcessPerConfig[] = "--separate-process-per-config";
constexpr char kUseConfig[] = "--use-config=";
constexpr char kSeparateProcessPerConfig[] = "--separate-process-per-config";
constexpr char kEnableANGLEPerTestCaptureLabel[] = "--angle-per-test-capture-label";
bool RunSeparateProcessesForEachConfig(int *argc, char *argv[])
{
......@@ -351,6 +355,16 @@ bool RunSeparateProcessesForEachConfig(int *argc, char *argv[])
}
return success;
}
void SetupEnvironmentVarsForCaptureReplay()
{
const ::testing::TestInfo *const testInfo =
::testing::UnitTest::GetInstance()->current_test_info();
std::string testName = std::string{testInfo->name()};
std::replace(testName.begin(), testName.end(), '/', '_');
SetEnvironmentVar("ANGLE_CAPTURE_LABEL",
(std::string{testInfo->test_case_name()} + "_" + testName).c_str());
}
} // anonymous namespace
// static
......@@ -553,7 +567,10 @@ void ANGLETestBase::ANGLETestSetUp()
}
needSwap = true;
}
if (gEnableANGLEPerTestCaptureLabel)
{
SetupEnvironmentVarsForCaptureReplay();
}
// WGL tests are currently disabled.
if (mFixture->wglWindow)
{
......@@ -1372,6 +1389,11 @@ void ANGLEProcessTestArgs(int *argc, char *argv[])
{
gSeparateProcessPerConfig = true;
}
if (strncmp(argv[argIndex], kEnableANGLEPerTestCaptureLabel,
strlen(kEnableANGLEPerTestCaptureLabel)) == 0)
{
gEnableANGLEPerTestCaptureLabel = true;
}
}
if (gSeparateProcessPerConfig)
......
......@@ -147,7 +147,8 @@ constexpr size_t kMaxConfigNameLen = 100;
std::array<char, kMaxConfigNameLen> gSelectedConfig;
} // namespace
bool gSeparateProcessPerConfig = false;
bool gSeparateProcessPerConfig = false;
bool gEnableANGLEPerTestCaptureLabel = false;
bool IsConfigSelected()
{
......
......@@ -248,6 +248,7 @@ bool IsConfigSelected();
// driver flakiness when using multiple APIs/windows/etc in the same
// process.
extern bool gSeparateProcessPerConfig;
extern bool gEnableANGLEPerTestCaptureLabel;
// For use with ANGLE_INSTANTIATE_TEST_ARRAY
template <typename ParamsT>
......
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