diff --git a/libc/test/UnitTest/LibcDeathTestExecutors.cpp b/libc/test/UnitTest/LibcDeathTestExecutors.cpp index e43dbb19ad152..77b0559c7acea 100644 --- a/libc/test/UnitTest/LibcDeathTestExecutors.cpp +++ b/libc/test/UnitTest/LibcDeathTestExecutors.cpp @@ -14,13 +14,18 @@ #include +namespace { +constexpr unsigned TIMEOUT_MS = 10000; +} // Anonymous namespace + namespace LIBC_NAMESPACE_DECL { namespace testing { bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal, const char *LHSStr, const char *RHSStr, internal::Location Loc) { - testutils::ProcessStatus Result = testutils::invoke_in_subprocess(Func, 1000); + testutils::ProcessStatus Result = + testutils::invoke_in_subprocess(Func, TIMEOUT_MS); if (const char *error = Result.get_error()) { Ctx->markFail(); @@ -32,7 +37,7 @@ bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal, if (Result.timed_out()) { Ctx->markFail(); tlog << Loc; - tlog << "Process timed out after " << 1000 << " milliseconds.\n"; + tlog << "Process timed out after " << TIMEOUT_MS << " milliseconds.\n"; return false; } @@ -63,7 +68,8 @@ bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal, bool Test::testProcessExits(testutils::FunctionCaller *Func, int ExitCode, const char *LHSStr, const char *RHSStr, internal::Location Loc) { - testutils::ProcessStatus Result = testutils::invoke_in_subprocess(Func, 1000); + testutils::ProcessStatus Result = + testutils::invoke_in_subprocess(Func, TIMEOUT_MS); if (const char *error = Result.get_error()) { Ctx->markFail(); @@ -75,7 +81,7 @@ bool Test::testProcessExits(testutils::FunctionCaller *Func, int ExitCode, if (Result.timed_out()) { Ctx->markFail(); tlog << Loc; - tlog << "Process timed out after " << 1000 << " milliseconds.\n"; + tlog << "Process timed out after " << TIMEOUT_MS << " milliseconds.\n"; return false; }