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
|
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()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user