From 8001de6728b825cdf7b36908f6a9429b03de5e74 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 1 Jun 2026 21:55:53 +0530 Subject: [PATCH] feat(runner): add MaxSteps bound to Options --- internal/runner/runner.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index ae2b21a..f24adcf 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -29,6 +29,11 @@ type Options struct { Duration time.Duration IdleTimeout time.Duration + // MaxSteps caps the run at a fixed number of steps for reproducible + // bounded runs. 0 means unbounded (the duration deadline governs); a + // positive value stops the loop once that many steps have run. + MaxSteps int + BundleID string Driver driver.DeviceDriver Verifier *verifier.Verifier @@ -83,6 +88,9 @@ func Run(ctx context.Context, options Options) (Summary, error) { if err := ctx.Err(); err != nil { break } + if options.MaxSteps > 0 && stepIndex >= options.MaxSteps { + break + } stepIndex++ stepStart := time.Now()