From bfe87644391d5b66dbee2bd4a6c7b6c181dec8d3 Mon Sep 17 00:00:00 2001 From: andrussal Date: Tue, 6 Jan 2026 13:42:37 +0100 Subject: [PATCH] runner: honor duration with no workloads --- .../core/src/scenario/runtime/runner.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testing-framework/core/src/scenario/runtime/runner.rs b/testing-framework/core/src/scenario/runtime/runner.rs index b5771b5..663c6d7 100644 --- a/testing-framework/core/src/scenario/runtime/runner.rs +++ b/testing-framework/core/src/scenario/runtime/runner.rs @@ -107,6 +107,21 @@ impl Runner { where Caps: Send + Sync, { + if scenario.workloads().is_empty() { + let duration = scenario.duration(); + if !duration.is_zero() { + sleep(duration).await; + } + + if let Some(cooldown) = Self::cooldown_duration(context.as_ref()) { + if !cooldown.is_zero() { + sleep(cooldown).await; + } + } + + return Ok(()); + } + let mut workloads = Self::spawn_workloads(scenario, context); let _ = Self::drive_until_timer(&mut workloads, scenario.duration()).await?;