Prompt

How do I run a load test in CI/CD

Technology / Testing & QA2 observationsLast seen Nov 21, 2026

Latest observation

Nov 21, 2026OpenAI APIWeb search: off

To run a load test in CI/CD, you generally want to:

  1. Define a repeatable test

    • Choose a load testing tool: k6, JMeter, Locust, Gatling, etc.
    • Store the test script in your repo.
    • Make the test deterministic: fixed number of users, duration, ramp-up, endpoints, and thresholds.
  2. Set up a test environment

    • Run load tests against a staging/pre-prod environment, not production.
    • Make sure it mirrors production closely enough: same app version, similar config, realistic data, and scaled infrastructure if possible.
  3. Add it to your pipeline Typical flow:

    • Build
    • Unit tests
    • Integration tests
    • Deploy to staging
    • Run load test
    • Fail pipeline if thresholds are exceeded
  4. Use pass/fail thresholds Example thresholds:

    • p95 latency < 300ms
    • error rate < 1%
    • throughput >= expected RPS
    • no CPU/memory saturation
  5. Keep the test short for CI

    • In PR pipelines: small smoke load test (1–5 minutes)
    • In nightly/scheduled pipelines: full load, stress, or soak tests

Example with k6 in CI/CD

loadtest.js

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '1m', target: 20 },
    { duration: '2m', target: 50 },
    { duration: '1m', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<300'],
    http_req_failed: ['rate<0.01'],
  },
};

export default function () {
  const res = http.get('https://staging.example.com/api/health');
  check(res, { 'status is 200': (r) => r.status === 200 });
  sleep(1);
}

GitHub Actions example

name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run unit tests
        run: npm test

      - name: Deploy to staging
        run: ./deploy-staging.sh

      - name: Run load test
        uses: grafana/k6-action@v0.3.1
        with:
          filename: loadtest.js
        env:
          K6_URL: https://staging.example.com

Best practices

  • Run small load tests on PRs and larger tests on a schedule.
  • Gate merges only on lightweight load checks to avoid slowing developers too much.
  • Monitor the system during tests: APM, logs, metrics, and tracing.
  • Use production-like data if possible.
  • Avoid sharing environments with other heavy tests.
  • Document baseline performance so you can detect regressions.
  • Test one thing at a time: isolate API, DB, cache, or auth changes when possible.

Common pitfalls

  • Running load tests on production without safeguards
  • Using too few or unrealistic test data
  • No clear pass/fail criteria
  • Tests that are flaky because of shared environments
  • Long tests in every PR, which slow CI too much
  • Ignoring backend dependencies like DB, queues, or third-party services

If you want, I can give you:

  • a GitHub Actions / GitLab CI / Jenkins example,
  • a k6 or JMeter setup,
  • or a recommended pipeline design for your stack.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.