[dartfuzz] Avoid LUCI's I/O timeout.

Print the number of pending task every 5 minutes to avoid getting killed by the 20 minute I/O timeout. We'll still get killed if we exceed the 50 minute step timeout.

Change-Id: I0bc12c5b78176303432d35fc6107b669ed7c6a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365282
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Ryan Macnak
2024-05-02 19:36:09 +00:00
committed by Commit Queue
parent 1d359dbb53
commit 3bba14e56e
+28 -2
View File
@@ -115,7 +115,29 @@ List<String> someOf(List<String> choices) {
return result;
}
// LUCI will kill recipe steps if they go 1200 seconds without any output.
const statusTimeout = Duration(minutes: 5);
int pendingTaskCount = 0;
late Timer pendingTimer;
Stopwatch stopwatch = new Stopwatch();
taskStart() {
if (pendingTaskCount++ == 0) {
pendingTimer = new Timer.periodic(statusTimeout, (timer) {
print("$pendingTaskCount tasks still running after "
"${stopwatch.elapsed.inMinutes} minutes");
});
}
}
taskEnd() {
if (--pendingTaskCount == 0) {
pendingTimer.cancel();
}
}
test(int taskIndex) async {
taskStart();
var buildDir = oneOf(buildDirs);
var commands;
@@ -196,7 +218,7 @@ test(int taskIndex) async {
timer.cancel();
if (timedOut) {
print("Timeout: $cmdline");
return;
break;
} else if (exitCode == 0) {
print("Success: $cmdline");
process.stdout.drain();
@@ -215,12 +237,16 @@ test(int taskIndex) async {
print("stderr:");
print(stderr);
exitCode = 1;
return;
break;
}
}
taskEnd();
}
main() async {
stopwatch.start();
await Directory("out/dartfuzz").create();
var executable = "out/ReleaseX64/dart";