From 4e81445d42c4bde0f157d7595030161f18c81f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Mon, 12 Jun 2023 15:30:51 +0200 Subject: [PATCH] Stop the fuzzer after an hour --- fuzzers/src/bin/fuzz-indexing.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fuzzers/src/bin/fuzz-indexing.rs b/fuzzers/src/bin/fuzz-indexing.rs index 4c6a55575..1d53e069c 100644 --- a/fuzzers/src/bin/fuzz-indexing.rs +++ b/fuzzers/src/bin/fuzz-indexing.rs @@ -130,9 +130,14 @@ fn main() { let start = std::time::Instant::now(); loop { let total = progression.load(Ordering::Relaxed); + let elapsed = start.elapsed().as_secs(); + if elapsed > 3600 { + // after 1 hour, stop the fuzzer, success + std::process::exit(0); + } println!( - "Has been running for {:?}. Tested {} new values for a total of {}.", - start.elapsed(), + "Has been running for {:?} seconds. Tested {} new values for a total of {}.", + elapsed, total - last_value, total );