Skip to content

Commit 3441858

Browse files
committed
[llvm][cas] Attempt to avoid timeouts in multi-process test
I reduced the test "work" until it was reliably less than half a second on my machine, since it was previously close to 3 seconds. I also bumped up the timeout to account for possibly very slow CI systems. rdar://147594425 (cherry picked from commit 2ab8bfc)
1 parent c1f3621 commit 3441858

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/unittests/CAS/OnDiskCASLoggerTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ TEST(OnDiskCASLoggerTest, MultiProcess) {
141141
Succeeded());
142142

143143
for (int I = 0; I < 10; ++I) {
144-
writeToLog(Logger.get(), /*NumOpens=*/10, /*NumEntries=*/100);
144+
writeToLog(Logger.get(), /*NumOpens=*/5, /*NumEntries=*/50);
145145
}
146146
exit(0);
147147
}
@@ -157,7 +157,7 @@ TEST(OnDiskCASLoggerTest, MultiProcess) {
157157

158158
std::string Error;
159159
SmallVector<ProcessInfo> PIs;
160-
for (int I = 0; I < 10; ++I) {
160+
for (int I = 0; I < 5; ++I) {
161161
bool ExecutionFailed;
162162
auto PI = ExecuteNoWait(Executable, Argv, ArrayRef<StringRef>{}, {}, 0, &Error,
163163
&ExecutionFailed);
@@ -166,7 +166,8 @@ TEST(OnDiskCASLoggerTest, MultiProcess) {
166166
}
167167

168168
for (auto &PI : PIs) {
169-
auto Result = Wait(PI, /*Timeout=*/5, &Error);
169+
// Note: this is typically <1 second, but account for slow CI systems.
170+
auto Result = Wait(PI, /*Timeout=*/15, &Error);
170171
ASSERT_TRUE(Error.empty()) << Error;
171172
ASSERT_EQ(Result.Pid, PI.Pid);
172173
ASSERT_EQ(Result.ReturnCode, 0);

0 commit comments

Comments
 (0)