{"record":{"id":"593bff3ee9ae38c5","repo":"grafana/k6","slug":"the-duration-must-be-at-least-s-but-is-s","errorCode":null,"errorMessage":"the duration must be at least %s, but is %s","messagePattern":"the duration must be at least (.+?), but is (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/constant_arrival_rate.go","lineNumber":106,"sourceCode":"}\n\n// Validate makes sure all options are configured and valid\nfunc (carc *ConstantArrivalRateConfig) Validate() []error {\n\terrors := carc.BaseConfig.Validate()\n\tif !carc.Rate.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the iteration rate isn't specified\"))\n\t} else if carc.Rate.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the iteration rate must be more than 0\"))\n\t}\n\n\tif carc.TimeUnit.TimeDuration() <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the timeUnit must be more than 0\"))\n\t}\n\n\tif !carc.Duration.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the duration is unspecified\"))\n\t} else if carc.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, carc.Duration,\n\t\t))\n\t}\n\n\tif !carc.PreAllocatedVUs.Valid {\n\t\terrors = append(errors, fmt.Errorf(\"the number of preAllocatedVUs isn't specified\"))\n\t} else if carc.PreAllocatedVUs.Int64 < 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of preAllocatedVUs can't be negative\"))\n\t}\n\n\tif !carc.MaxVUs.Valid {\n\t\t// TODO: don't change the config while validating\n\t\tcarc.MaxVUs.Int64 = carc.PreAllocatedVUs.Int64\n\t} else if carc.MaxVUs.Int64 < carc.PreAllocatedVUs.Int64 {\n\t\terrors = append(errors, fmt.Errorf(\"maxVUs can't be less than preAllocatedVUs\"))\n\t}\n\n\treturn errors","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/constant_arrival_rate.go#L88-L124","documentation":"ConstantArrivalRateConfig.Validate found the duration shorter than minDuration (100ms). Arrival-rate executors enforce a minimum duration so the scheduling loop can meaningfully start iterations; very short durations are rejected outright.","triggerScenarios":"Thrown at lib/executor/constant_arrival_rate.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase duration to at least 100ms (e.g. '1s')","For very short tests consider the per-vu-iterations or shared-iterations executor 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"}