Skip to content

feat: add load testing scripts and configuration for various scenarios#19

Merged
DanielPopoola merged 1 commit into
masterfrom
go-version
Apr 13, 2026
Merged

feat: add load testing scripts and configuration for various scenarios#19
DanielPopoola merged 1 commit into
masterfrom
go-version

Conversation

@DanielPopoola
Copy link
Copy Markdown
Owner

@DanielPopoola DanielPopoola commented Apr 13, 2026

Summary by CodeRabbit

  • New Features

    • Added load test scenarios: baseline queue test, sustained traffic test, spike test, breakpoint test, contention test, and polling bottleneck test.
    • Added token generation utility for load testing.
    • Added shared configuration and setup helper modules for load tests.
  • Removed

    • Removed legacy load test scenarios: thundering herd, sustained load, and correctness check tests.
  • Chores

    • Updated .gitignore to normalize file entries and exclude token data.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request refactors the loadtest suite by removing three existing k6 load-test scripts and replacing them with six new test scenarios. It introduces three shared library modules for configuration, setup, and token management, plus a token generation utility. The changes consolidate common functionality into reusable modules.

Changes

Cohort / File(s) Summary
Configuration and Ignores
.gitignore
Normalized build-errors.log entry and added ignore rule for loadtest/scripts/tokens.json.
Removed Loadtest Scripts
loadtest/scripts/01_thundering_herd.js, loadtest/scripts/02_sustained_load.js, loadtest/scripts/03_correctness_check.js
Deleted three existing k6 load-test scripts (260 lines removed). 01_thundering_herd.js performed stage-based VU ramping with OTP flow; 02_sustained_load.js executed full customer flow with ticket claiming; 03_correctness_check.js validated event stats post-test.
New Baseline and Sustained Tests
loadtest/scripts/01_baseline.js, loadtest/scripts/02_sustained.js
Added simplified queue-join tests replacing deleted scripts. 01_baseline.js uses fixed load (50 VUs, 2m duration) with threshold checks. 02_sustained.js ramps load to 500 VUs over 5 minutes, sustains for 30 minutes, then ramps down with per-VU sleep between requests.
New Spike, Breakpoint, and Contention Tests
loadtest/scripts/03_spike.js, loadtest/scripts/04_breakpoint.js, loadtest/scripts/05_contention.js
Added specialized load-test scenarios. 03_spike.js uses constant-arrival-rate (20k iter/s, 30s) with 10k–60k VU allocation. 04_breakpoint.js ramps VUs to 40k across five 2-minute stages. 05_contention.js uses 20k fixed VUs with polling loop to wait for queue admission and claim ticket.
New Polling and Token Generation Tests
loadtest/scripts/06_polling.js, loadtest/scripts/generate_tokens.js
Added polling-focused test (5k VUs, 5m duration) and standalone token generation script. 06_polling.js repeatedly GETs queue position. generate_tokens.js bulk-generates and persists auth tokens to tokens.json via OTP flow.
Shared Loadtest Libraries
loadtest/scripts/lib/config.js, loadtest/scripts/lib/setup.js, loadtest/scripts/lib/tokens.js
Added three reusable modules. config.js exports BASE_URL, DEFAULT_HEADERS(), and requireEnv(). setup.js exports setupEvent() for organizer login, event creation, and activation. tokens.js exports token dataset (via SharedArray) and getToken(vu) selector function.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hop, hop—the tests now leap and bound,
With spikes and polling all around!
Old scripts retire, new ones spring,
Shared lib-rar-ies make burrows sing, 🌾
The fairqueue hops more load each day!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change—adding multiple k6 load testing scripts and supporting configuration modules for different test scenarios.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch go-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DanielPopoola DanielPopoola merged commit 196c4b1 into master Apr 13, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant