{"record":{"id":"9ac31ac6a509d421","repo":"grafana/k6","slug":"the-number-of-iterations-d-can-t-be-less-than-t","errorCode":null,"errorMessage":"the number of iterations (%d) can't be less than the number of VUs (%d)","messagePattern":"the number of iterations \\((.+?)\\) can't be less than the number of VUs \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/executor/shared_iterations.go","lineNumber":83,"sourceCode":"\treturn newTuple.ScaleInt64(sic.Iterations.Int64)\n}\n\n// GetDescription returns a human-readable description of the executor options\nfunc (sic SharedIterationsConfig) GetDescription(et *lib.ExecutionTuple) string {\n\treturn fmt.Sprintf(\"%d iterations shared among %d VUs%s\",\n\t\tsic.GetIterations(et), sic.GetVUs(et),\n\t\tsic.getBaseInfo(fmt.Sprintf(\"maxDuration: %s\", sic.MaxDuration.Duration)))\n}\n\n// Validate makes sure all options are configured and valid\nfunc (sic SharedIterationsConfig) Validate() []error {\n\terrors := sic.BaseConfig.Validate()\n\tif sic.VUs.Int64 <= 0 {\n\t\terrors = append(errors, fmt.Errorf(\"the number of VUs must be more than 0\"))\n\t}\n\n\tif sic.Iterations.Int64 < sic.VUs.Int64 {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the number of iterations (%d) can't be less than the number of VUs (%d)\",\n\t\t\tsic.Iterations.Int64, sic.VUs.Int64,\n\t\t))\n\t}\n\n\tif sic.MaxDuration.TimeDuration() < minDuration {\n\t\terrors = append(errors, fmt.Errorf(\n\t\t\t\"the maxDuration must be at least %s, but is %s\", minDuration, sic.MaxDuration,\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","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/executor/shared_iterations.go#L65-L101","documentation":"Raised by SharedIterationsConfig.Validate when the shared-iterations scenario declares fewer total iterations than VUs. k6 requires at least one iteration per VU because every VU must be able to run at least once.","triggerScenarios":"Thrown at lib/executor/shared_iterations.go:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase iterations so it is greater than or equal to vus","Reduce vus so each VU gets at least one iteration"],"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"}