Skip to content

Commit

Permalink
disable K6_SETUP_TIMEOUT option when 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukasaI committed Aug 14, 2024
1 parent 930e7eb commit f5bd195
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions execution/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,10 @@ func (e *Scheduler) Run(globalCtx, runCtx context.Context, samplesOut chan<- met
// its properties in their init context executions.
withExecStateCtx := lib.WithExecutionState(runCtx, e.state)

// Run setup() before any executors, if it's not disabled
if !e.state.Test.Options.NoSetup.Bool {
// Run setup() before any executors, if it's not disabled.
// When SetupTimeout is 0, setuo() is disabled.
shouldSetup := !e.state.Test.Options.NoSetup.Bool && (e.state.Test.Options.SetupTimeout.Valid && e.state.Test.Options.SetupTimeout.Duration != 0)
if shouldSetup {
e.state.SetExecutionStatus(lib.ExecutionStatusSetup)
e.initProgress.Modify(pb.WithConstProgress(1, "setup()"))
actuallyRanSetup := false
Expand Down

0 comments on commit f5bd195

Please # to comment.