feat(qss-stress): toxiproxy harness, precise wire-fault hooks, jest config#3219
Open
holmesworcester wants to merge 1 commit into
Open
feat(qss-stress): toxiproxy harness, precise wire-fault hooks, jest config#3219holmesworcester wants to merge 1 commit into
holmesworcester wants to merge 1 commit into
Conversation
…onfig Brings the QSS stress tooling onto 7.1.0. Scenario specs land separately. - harness.ts — bootQssHarness/bootMemberHarness with per-test toxiproxy isolation (unique proxy name + free local port per call). - toxiproxy.ts — zero-dep client for the toxiproxy admin API with retry-with-backoff for transient 503/timeout/ECONNRESET (admin API is single-threaded and returns transient errors under concurrent load). - precise-faults.ts — installWireFaultHooks() monkey-patches qssClient.sendMessage for per-message faults (drop / delay / error / busy-wait pause) keyed by WebsocketEvents. - docker-compose.yml — toxiproxy sidecar. - jest.stress.config.js + test-stress-qss script + testPathIgnorePatterns exclusion so *.stress.spec.ts never runs in default test/test-ci. - start:qss:toxi / stop:qss:toxi root scripts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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
Lands the QSS stress tooling on 7.1.0 — the toxiproxy harness, wire-fault hook, jest config, and helper scripts. Scenario specs (the proofs-of-concept used during the QSS investigation) are intentionally left out of this PR and will land separately on top.
What's in
Harness:
harness.ts—bootQssHarness()/bootMemberHarness()boot the QSS path of the Nest app behind toxiproxy. Per-test proxy isolation: every call allocates a unique proxy name and free local port and tears it down on shutdown, so multiple stress runs can execute in parallel under jest's--maxWorkerswithout colliding.precise-faults.ts—installWireFaultHooks()monkey-patchesqssClient.sendMessageto inject precise per-message faults (drop / delay / error / busy-wait pause) keyed byWebsocketEventstype. Helpers:scheduleOutageAfter,oneShot,busyWaitPause. Use it when network-level toxiproxy chaos is too coarse and a bug needs message-type granularity.toxiproxy.ts— tiny zero-dep client for the toxiproxy admin API with retry-with-backoff for transient 503/timeout/ECONNRESET. The admin API is single-threaded; under concurrent load it returns transient errors that are safe to retry. Also splitsrawRequestfromrequestand surfaces HTTP status on errors.docker-compose.yml— toxiproxy sidecar (host networking on Linux).README.md— usage and configuration.Test plumbing:
packages/backend/jest.stress.config.js— dedicated jest config for the stress harness (ts-jest ESM, type-diagnostics off, longer timeout, scopedtestRegex).packages/backend/package.json—test-stress-qssscript +testPathIgnorePatternsso*.stress.spec.tsis excluded from defaulttest/test-ci.Scripts:
package.json—start:qss:toxi/stop:qss:toxiconvenience wrappers arounddocker composefor the toxiproxy sidecar.Not in this PR
Scenario specs (
scenarios/*.stress.spec.ts), the chaos profile catalog (fuzz.ts), invariant probes (invariants.ts), andFINDINGS.mdare part of the investigation work and will land in follow-ups.Test plan
npm run start:qss(existing)npm run start:qss:toxibrings up the toxiproxy sidecarcd packages/backend && npm run test-stress-qss— currently a no-op since no*.stress.spec.tsexist on this branch yet; should run jest cleanly with no test files matchednpm run test/npm run test-cidoes not pick up anything undersrc/nest/qss/stress/(excluded viatestPathIgnorePatterns)npm run stop:qss:toxi