test(load): add rate-limiter, event-listener, GraphQL, and webhook load scenarios#1186
Merged
Emmyt24 merged 1 commit intoMay 28, 2026
Conversation
…ad scenarios Implements four load-test scenarios and their supporting vitest-testable helper libraries (135 unit tests added across 4 helper modules). --- nova-launch01#1098 — Rate-limiter accuracy under high concurrent request pressure --- - scenarios/ratelimiter-accuracy.js: fires 50 VUs (≈5× the default 100 req/min budget) against the rate-limit endpoint for one full window (60 s). Asserts allowed count matches budget within ±5 % tolerance; denied requests are checked for HTTP 429. - lib/ratelimiter-helpers.js: classifyResponse, withinTolerance, buildRateLimitReport, formatRateLimitSummary. - scripts/ratelimiter-helpers.test.js: 28 unit tests. Concurrency: 50 VUs · Window: 60 s · Budget: 100 req/window · Tolerance: ±5 % --- nova-launch01#1097 — Stellar event-listener stability under sustained ingestion load --- - scenarios/event-listener-sustained.js: drives 20 VUs for 120 s posting synthetic events to the ingest endpoint. Measures ingestion lag per request and asserts p95 lag < 500 ms with zero violations. - lib/event-listener-helpers.js: computeLagMs, isLagWithinThreshold, buildLagReport, formatLagSummary. - scripts/event-listener-helpers.test.js: 23 unit tests. Duration: 120 s · VUs: 20 · Lag threshold: 500 ms --- nova-launch01#1096 — GraphQL query performance under sustained concurrent load --- - scenarios/graphql-performance.js: issues a representative query mix (40 % tokens_list, 25 % token_detail, 20 % streams_list, 15 % proposals_list) at 20 VUs for 60 s. Enforces p50 < 200 ms, p95 < 500 ms, p99 < 1 000 ms, error rate < 1 %. - lib/graphql-helpers.js: selectGraphQLQuery, computePercentile, meetsLatencyThresholds, buildLatencyReport, formatLatencySummary. - scripts/graphql-helpers.test.js: 25 unit tests. --- nova-launch01#1095 — Webhook delivery throughput benchmark --- - scenarios/webhook-throughput.js: generates a sustained stream of webhook-triggering POSTs at 20 VUs for 60 s against a configurable test sink. Asserts throughput >= 50 deliveries/sec and error rate <= 1 %. - lib/webhook-helpers.js: computeThroughput, computeErrorRate, passesThresholds, buildThroughputReport, formatThroughputSummary. - scripts/webhook-helpers.test.js: 27 unit tests. Each scenario writes a JSON summary to load-tests/results/ and prints a human-readable report to stdout. All k6 env-var overrides are documented in each file header. Closes nova-launch01#1095 Closes nova-launch01#1096 Closes nova-launch01#1097 Closes nova-launch01#1098 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Fidelis900 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four load-test scenarios (k6) and their vitest-testable helper libraries covering issues #1095 – #1098. Each scenario ships with:
load-tests/scenarios/load-tests/lib/(no k6 runtime dependency)load-tests/scripts/135 unit tests added; all passing.
#1098 — Rate-limiter accuracy under high concurrent request pressure
Scenario:
load-tests/scenarios/ratelimiter-accuracy.jsrl_allowed_requests,rl_denied_requests,rl_error_requests,rl_denied_rate.lib/ratelimiter-helpers.js—classifyResponse,withinTolerance,buildRateLimitReport,formatRateLimitSummary(28 unit tests).#1097 — Stellar event-listener stability under sustained ingestion load
Scenario:
load-tests/scenarios/event-listener-sustained.jslib/event-listener-helpers.js—computeLagMs,isLagWithinThreshold,buildLagReport,formatLagSummary(23 unit tests).#1096 — GraphQL query performance under sustained concurrent load
Scenario:
load-tests/scenarios/graphql-performance.jsPOST /api/graphql.tokens_list· 25 %token_detail· 20 %streams_list· 15 %proposals_list.lib/graphql-helpers.js—selectGraphQLQuery,computePercentile,meetsLatencyThresholds,buildLatencyReport,formatLatencySummary(25 unit tests).#1095 — Webhook delivery throughput benchmark
Scenario:
load-tests/scenarios/webhook-throughput.jsWEBHOOK_SINK_URL.lib/webhook-helpers.js—computeThroughput,computeErrorRate,passesThresholds,buildThroughputReport,formatThroughputSummary(27 unit tests).Files changed
load-tests/scenarios/ratelimiter-accuracy.jsload-tests/lib/ratelimiter-helpers.jsload-tests/scripts/ratelimiter-helpers.test.jsload-tests/scenarios/event-listener-sustained.jsload-tests/lib/event-listener-helpers.jsload-tests/scripts/event-listener-helpers.test.jsload-tests/scenarios/graphql-performance.jsload-tests/lib/graphql-helpers.jsload-tests/scripts/graphql-helpers.test.jsload-tests/scenarios/webhook-throughput.jsload-tests/lib/webhook-helpers.jsload-tests/scripts/webhook-helpers.test.jsTest plan
cd load-tests && npx vitest run— 135 tests across 5 test files, all passingk6 run scenarios/ratelimiter-accuracy.js— requires k6 + running backendk6 run scenarios/event-listener-sustained.js— requires k6 + running backendk6 run scenarios/graphql-performance.js— requires k6 + running backendk6 run scenarios/webhook-throughput.js— requires k6 + running backend + test sinkCloses #1095
Closes #1096
Closes #1097
Closes #1098
🤖 Generated with Claude Code