Skip to content
Latchkey

When Not to Run Heavy Load Tests in CI

Heavy load on every PR burns runner minutes and can hammer shared environments, so reserve it for scheduled runs and gate PRs with a cheap smoke test.

Load tests are expensive in minutes and can affect shared staging. Run a light smoke test per PR for a fast gate, and push full load, stress, and soak runs to a nightly schedule.

Reasons to keep heavy load out of per-PR CI

  • Cost: a long run at high VUs multiplies runner minutes across every PR.
  • Contention: many PRs hitting one staging environment skew each other's numbers.
  • Signal: a smoke test already catches a fully broken deploy cheaply.

Cheap per-PR smoke instead

k6-script.js
export const options = {
  vus: 2,
  duration: '20s',
  thresholds: { http_req_failed: ['rate<0.01'] },
};

Gotchas

  • Load testing against production without a plan can trigger rate limits or an incident.
  • If PRs must run load, cap VUs and duration and run against an isolated environment.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →