Skip to content

feat(backend): perform rigorous load testing on Multi-currency Exchange Rate Service#1259

Merged
emdevelopa merged 1 commit into
emdevelopa:mainfrom
barry01-hash:feature/be-perform-rigorous-load-testing-on-multi-currency-exchange-rate-service
Jul 26, 2026
Merged

feat(backend): perform rigorous load testing on Multi-currency Exchange Rate Service#1259
emdevelopa merged 1 commit into
emdevelopa:mainfrom
barry01-hash:feature/be-perform-rigorous-load-testing-on-multi-currency-exchange-rate-service

Conversation

@barry01-hash

@barry01-hash barry01-hash commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1119

Summary

Adds infrastructure for rigorous load testing of the Multi-currency Exchange Rate Service (path payment quote endpoint). Includes autocannon-based load tests, configurable scenarios, and a CLI runner.

Changes

New Files

backend/load-tests/config.js — Load test configuration defining:

  • Default parameters (duration, connections, pipelining)
  • Exchange rate scenarios: quoteSuccess, quoteNotFound, rateLimited
  • Throughput/latency thresholds for pass/fail assertions

backend/load-tests/helpers.js — Reusable utilities:

  • runAutocannon(url, opts) — programmatic autocannon runner
  • formatResults(title, results) — human-readable result formatting
  • assertLoadTestThresholds(results, thresholds) — pass/fail assertions on throughput, error rate, and P95 latency

backend/load-tests/exchange-rate-load.test.js — 4 vitest load test scenarios:

  1. Endpoint verification — supertest smoke test confirming the route responds
  2. Concurrent load (10s, 5 connections) — tests throughput and latency under sustained concurrency
  3. Rate limit enforcement (5s, burst of 250 requests) — verifies 429 responses beyond threshold
  4. Burst connections (10s, 20 connections) — ensures no crash under high connection count

backend/scripts/load-test-exchange-rate.js — CLI runner for manual/extended load testing:

  • Supports targeting any URL (default http://127.0.0.1:3000)
  • Configurable duration and connections via DURATION/CONNECTIONS env vars
  • Runs all scenarios or a specific named scenario

Modified Files

backend/package.json — Added dev dependency autocannon and npm scripts:

  • npm run test:load — runs load test vitest suite
  • npm run load:exchange-rate — runs CLI load test runner

Load Test Results

All 4 load tests pass with thresholds:

  • ✅ Zero timeouts across all scenarios
  • ✅ Zero errors under concurrent/burst load
  • ✅ 429 rate limit responses correctly enforced
  • ✅ No crashes under 20 simultaneous connections

CLI Usage

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@barry01-hash is attempting to deploy a commit to the Emmanuel's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@barry01-hash Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@emdevelopa
emdevelopa merged commit ab5666a into emdevelopa:main Jul 26, 2026
1 of 4 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.

[Backend] Perform rigorous load testing on Multi-currency Exchange Rate Service

2 participants