Skip to content

Commit 9b02b75

Browse files
[libc] Increase test timeout (#99678)
This patch increases the timeout of the libc test from 1s to 10s, mostly because rv32 runs in a qemu image and sometimes 1s is just not enough for the test to finish when there are other tests running in parallel
1 parent a96c906 commit 9b02b75

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

libc/test/UnitTest/LibcDeathTestExecutors.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414

1515
#include <cassert>
1616

17+
namespace {
18+
constexpr unsigned TIMEOUT_MS = 10000;
19+
} // Anonymous namespace
20+
1721
namespace LIBC_NAMESPACE_DECL {
1822
namespace testing {
1923

2024
bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
2125
const char *LHSStr, const char *RHSStr,
2226
internal::Location Loc) {
23-
testutils::ProcessStatus Result = testutils::invoke_in_subprocess(Func, 1000);
27+
testutils::ProcessStatus Result =
28+
testutils::invoke_in_subprocess(Func, TIMEOUT_MS);
2429

2530
if (const char *error = Result.get_error()) {
2631
Ctx->markFail();
@@ -32,7 +37,7 @@ bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
3237
if (Result.timed_out()) {
3338
Ctx->markFail();
3439
tlog << Loc;
35-
tlog << "Process timed out after " << 1000 << " milliseconds.\n";
40+
tlog << "Process timed out after " << TIMEOUT_MS << " milliseconds.\n";
3641
return false;
3742
}
3843

@@ -63,7 +68,8 @@ bool Test::testProcessKilled(testutils::FunctionCaller *Func, int Signal,
6368
bool Test::testProcessExits(testutils::FunctionCaller *Func, int ExitCode,
6469
const char *LHSStr, const char *RHSStr,
6570
internal::Location Loc) {
66-
testutils::ProcessStatus Result = testutils::invoke_in_subprocess(Func, 1000);
71+
testutils::ProcessStatus Result =
72+
testutils::invoke_in_subprocess(Func, TIMEOUT_MS);
6773

6874
if (const char *error = Result.get_error()) {
6975
Ctx->markFail();
@@ -75,7 +81,7 @@ bool Test::testProcessExits(testutils::FunctionCaller *Func, int ExitCode,
7581
if (Result.timed_out()) {
7682
Ctx->markFail();
7783
tlog << Loc;
78-
tlog << "Process timed out after " << 1000 << " milliseconds.\n";
84+
tlog << "Process timed out after " << TIMEOUT_MS << " milliseconds.\n";
7985
return false;
8086
}
8187

0 commit comments

Comments
 (0)