{"record":{"id":"84dc5cb927a28110","repo":"grafana/k6","slug":"the-number-of-preallocatedvus-isn-t-specified","errorCode":null,"errorMessage":"the number of preAllocatedVUs isn't specified","messagePattern":"the number of preAllocatedVUs isn't specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/constant_arrival_rate.go","lineNumber":112,"sourceCode":"\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\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","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/constant_arrival_rate.go#L94-L130","documentation":"ConstantArrivalRateConfig.Validate found preAllocatedVUs unset. This executor requires VUs to be pre-warmed before the test starts so iterations can begin at the configured rate without initialization latency; the count must be present even if 0.","triggerScenarios":"Thrown at lib/executor/constant_arrival_rate.go:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add preAllocatedVUs, typically >= the expected steady-state VU need, e.g. preAllocatedVUs: 50","Keep maxVUs >= preAllocatedVUs; extra VUs are started on demand during the run"],"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"}