From f5bd195deb471a3d8b6791a1083a0755bbd6be39 Mon Sep 17 00:00:00 2001 From: tsukasa inoue Date: Thu, 15 Aug 2024 08:58:05 +0900 Subject: [PATCH] disable K6_SETUP_TIMEOUT option when 0 --- execution/scheduler.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/execution/scheduler.go b/execution/scheduler.go index 0759332ab77..55c7d828487 100644 --- a/execution/scheduler.go +++ b/execution/scheduler.go @@ -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