mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(runner): add MaxSteps bound to Options
This commit is contained in:
1 parent
b6a306286a
commit
8001de6728
1 file changed
+8
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user