Skip to content

[libc] Increase test timeout #99678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions libc/test/UnitTest/LibcDeathTestExecutors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@

#include <cassert>

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();
Expand All @@ -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;
}

Expand Down Expand Up @@ -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();
Expand All @@ -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;
}

Expand Down
Loading