feat(runner): add MaxSteps bound to Options

This commit is contained in:
pj committed 2026-06-01 21:55:53 +05:30
1 parent b6a306286a
commit 8001de6728
1 file changed
+8
+8
View File
@@ -29,6 +29,11 @@ type Options struct {
Duration time.Duration Duration time.Duration
IdleTimeout 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 BundleID string
Driver driver.DeviceDriver Driver driver.DeviceDriver
Verifier *verifier.Verifier Verifier *verifier.Verifier
@@ -83,6 +88,9 @@ func Run(ctx context.Context, options Options) (Summary, error) {
if err := ctx.Err(); err != nil { if err := ctx.Err(); err != nil {
break break
} }
if options.MaxSteps > 0 && stepIndex >= options.MaxSteps {
break
}
stepIndex++ stepIndex++
stepStart := time.Now() stepStart := time.Now()