From 3bba14e56e4e44eaff293140377ce2b42bc50d82 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 2 May 2024 19:36:09 +0000 Subject: [PATCH] [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 Reviewed-by: Alexander Markov --- runtime/tools/dartfuzz/flag_fuzzer.dart | 30 +++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/runtime/tools/dartfuzz/flag_fuzzer.dart b/runtime/tools/dartfuzz/flag_fuzzer.dart index 9d33120b66f..45b1204350b 100644 --- a/runtime/tools/dartfuzz/flag_fuzzer.dart +++ b/runtime/tools/dartfuzz/flag_fuzzer.dart @@ -115,7 +115,29 @@ List someOf(List 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";