{"record":{"id":"70d14ce92ec5ce8e","repo":"grafana/k6","slug":"the-duration-is-unspecified-70d14c","errorCode":null,"errorMessage":"the duration is unspecified","messagePattern":"the duration is unspecified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/constant_vus.go","lineNumber":72,"sourceCode":"func (clvc ConstantVUsConfig) GetVUs(et *lib.ExecutionTuple) int64 {\n\treturn et.ScaleInt64(clvc.VUs.Int64)\n}\n\n// GetDescription returns a human-readable description of the executor options\nfunc (clvc ConstantVUsConfig) GetDescription(et *lib.ExecutionTuple) string {\n\treturn fmt.Sprintf(\"%d looping VUs for %s%s\",\n\t\tclvc.GetVUs(et), clvc.Duration.Duration, clvc.getBaseInfo())\n}\n\n// Validate makes sure all options are configured and valid\nfunc (clvc ConstantVUsConfig) Validate() []error {\n\terrors := clvc.BaseConfig.Validate()\n\tif clvc.VUs.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of VUs must be more than 0\"))\n\t}\n\n\tif !clvc.Duration.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the duration is unspecified\"))\n\t} else if clvc.Duration.TimeDuration() < minDuration {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the duration must be at least %s, but is %s\", minDuration, clvc.Duration,\n\t\t))\n\t}\n\n\treturn errors\n}\n\n// GetExecutionRequirements returns the number of required VUs to run the\n// executor for its whole duration (disregarding any startTime), including the\n// maximum waiting time for any iterations to gracefully stop. This is used by\n// the execution scheduler in its VU reservation calculations, so it knows how\n// many VUs to pre-initialize.\nfunc (clvc ConstantVUsConfig) GetExecutionRequirements(et *lib.ExecutionTuple) []lib.ExecutionStep {\n\treturn []lib.ExecutionStep{\n\t\t{\n\t\t\tTimeOffset: 0,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/constant_vus.go#L54-L90","documentation":"ConstantVUsConfig.Validate found 'duration' unset. The constant-VUs executor has no natural end condition — VUs loop until the fixed duration elapses — so the option is required, unlike executors with iteration counts.","triggerScenarios":"Thrown at lib/executor/constant_vus.go:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add duration to the scenario, e.g. duration: '10m'","For a fixed number of iterations use per-vu-iterations or shared-iterations instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}