grafana/k6 · error

the number of preAllocatedVUs isn't specified

Error message

the number of preAllocatedVUs isn't specified

What it means

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.

Source

Thrown at lib/executor/constant_arrival_rate.go:112

		errors = append(errors, fmt.Errorf("the iteration rate isn't specified"))
	} else if carc.Rate.Int64 <= 0 {
		errors = append(errors, fmt.Errorf("the iteration rate must be more than 0"))
	}

	if carc.TimeUnit.TimeDuration() <= 0 {
		errors = append(errors, fmt.Errorf("the timeUnit must be more than 0"))
	}

	if !carc.Duration.Valid {
		errors = append(errors, fmt.Errorf("the duration is unspecified"))
	} else if carc.Duration.TimeDuration() < minDuration {
		errors = append(errors, fmt.Errorf(
			"the duration must be at least %s, but is %s", minDuration, carc.Duration,
		))
	}

	if !carc.PreAllocatedVUs.Valid {
		errors = append(errors, fmt.Errorf("the number of preAllocatedVUs isn't specified"))
	} else if carc.PreAllocatedVUs.Int64 < 0 {
		errors = append(errors, fmt.Errorf("the number of preAllocatedVUs can't be negative"))
	}

	if !carc.MaxVUs.Valid {
		// TODO: don't change the config while validating
		carc.MaxVUs.Int64 = carc.PreAllocatedVUs.Int64
	} else if carc.MaxVUs.Int64 < carc.PreAllocatedVUs.Int64 {
		errors = append(errors, fmt.Errorf("maxVUs can't be less than preAllocatedVUs"))
	}

	return errors
}

// GetExecutionRequirements returns the number of required VUs to run the
// executor for its whole duration (disregarding any startTime), including the
// maximum waiting time for any iterations to gracefully stop. This is used by
// the execution scheduler in its VU reservation calculations, so it knows how

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Add preAllocatedVUs, typically >= the expected steady-state VU need, e.g. preAllocatedVUs: 50
  2. Keep maxVUs >= preAllocatedVUs; extra VUs are started on demand during the run
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/executor/constant_arrival_rate.go:112 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/84dc5cb927a28110. Report an issue: GitHub.