Repository navigation
feat(load): add the smoke, stress and performance harness - #4589
Merged
Merged
Conversation
A separate, manually started test of a running deployment: a realistic OpenAI- and Anthropic-compatible mock provider, a bulk seeder (SQL identities with minted sessions, organizations through the API), seven personas of faker-driven virtual users with their journeys, a runner with smoke/load/stress/spike/soak/connections/signin-storm profiles across generator processes and shards, exact report merging, a local multi-process stack launcher, and the dispatch-only Load workflow.
The manual performance suite gains PERF-P16 (the smoke profile), its automation row names what the harness's own tests own, and the measurement guide and CONTRIBUTING send deployment-scale questions to tools/load instead of saying no load test exists.
…ency Knip's check counts an export no other module imports as dead; the harness's tests are now its entries, the module-local constants and helpers lose their export, and five declarations nothing used go.
This was referenced Oct 8, 2026
The run command could turn certificate checks off for self-signed targets. Drop the switch: a target behind a private authority trusts it through NODE_EXTRA_CA_CERTS and stays verified.
A cache_control breakpoint on the system block is the usual Anthropic pattern, but the mock only remembered prefixes ending in a message, so a single-turn request never read its system prompt from cache. Tools and the system prompt are now a prefix of their own.
The OpenAI and Anthropic clients parse, accumulate and raise exactly what a real provider would make them: buffered and streamed replies with usage, tool calls with schema-valid arguments, reasoning and signed thinking, prompt caching, max_tokens, rate limits, outages, mid-stream errors and missing keys. Unit tests pin option precedence, directives, latency calibration, chunking, the cache rules, stream capacity and stalls.
This was referenced Oct 8, 2026
yannickmonney
added this pull request to the merge queue
Oct 9, 2026
The launcher set TALE_ROLE, which only the container's entrypoint maps to ROLE; the backend reads ROLE, so every api and worker process ran every role. It now sets ROLE (and TALE_ROLE alongside), and a worker that exits at boot fails stack up instead of going unnoticed.
Ctrl-C reaches the whole process group, and the forked workers had no handler, so every worker died at once: no stop, no final snapshot, no wind-down, and the report listed each as failed. Workers now leave the signal to the orchestrator, which stops them over IPC; an orphaned worker still exits on the IPC disconnect.
A merged report copied the first shard's stages and breaking point, so a 50-shard million-user run claimed to have held through one shard's load. Stages now sum every shard per index (the slowest shard's p95 as an upper bound, held only where all held) and the run breaks at the earliest shard. A crashed, failed or killed generator exits 2, as the README promised, instead of reading as a threshold failure.
…sona - splitTarget floored proportional shares, so a rising target could lower one worker's share: a live user stopped while another worker started its replacement, and a full worker asked to take a user back threw. Users are now dealt round-robin, which only ever raises a share; a pool with no free index starts the rest on its next call. - stopAll waited only for users still live, not those a falling target had stopped, so a load run's wind-down waited for nobody. - Smoke drew 14 personas by hash and usually missed some, the same ones every run; it now deals them out on one process and reports the users it actually runs as its peak.
The reconnect attempt reset on every event, heartbeats included, so a stream dropped by a deploy came back within a uniform second: a whole generator's streams in one wave, unlike the browsers it models. A healthy stream now waits the server's retry (or EventSource's 3 s default); only one that keeps failing backs off with full jitter.
pg_stat_statements keeps a row per user, database, query and top level, and the diff keyed rows by query id alone, so a statement run by two roles or both nested and at top level was diffed against the wrong baseline. The read now sums the rows of each query.
- A tokens directive is cut to the request's ceiling before the reply is generated, not after: a huge one froze the event loop. - A schema's minItems and minLength are met up to 50 items and 4,096 characters. - An undecodable model id answers 404, not 500. - In cluster mode each worker admits its share of the stream limit; the prompt cache is documented as per process. - The LRU test now tells LRU from FIFO.
stack up advertised --host as the interface its processes listen on, but the backend had no listen address and bound every interface — an open-sign-up stack reachable from the local network. The API now takes an optional HOST (unset: every interface, as a container needs), and stack up passes its --host.
Each progress line and stage close re-merged every worker's whole series, decoding and re-encoding every window histogram of the run on the 1 s control loop, so the cost grew with run length. They now fold the windows they read; the final report still folds everything.
Hint latency only measured the hints that came. A task write made while its organization had an open stream in the process now counts as watched, and as unheard when no stream of the process heard it within 60 s: a hint the platform lost, told apart from a slow one.
yannickmonney
removed this pull request from the merge queue due to a manual request
Oct 9, 2026
yannickmonney
added this pull request to the merge queue
Oct 9, 2026
yannickmonney
removed this pull request from the merge queue due to a manual request
Oct 9, 2026
yannickmonney
added this pull request to the merge queue
Oct 9, 2026
yannickmonney
removed this pull request from the merge queue due to a manual request
Oct 9, 2026
yannickmonney
marked this pull request as draft
October 9, 2026 04:38
Deployments already set HOST to the public host name, which no interface answers to, so binding to it would stop the API from listening. The listen interface is BACKEND_LISTEN_HOST.
With one API the liveness check ran right after the workers spawned, too early to see one crash at boot.
Per-array and per-string bounds multiplied through nested arrays to about half a gigabyte; one budget of elements and characters now covers the whole value.
A merge of merged reports claimed as many shards as reports it took, and one report folded alone claimed a merge.
Only array elements and generated strings were counted, so nested arrays around an enum or const leaf or a wide object still built hundreds of megabytes. Optional properties stop once the budget is spent; required ones stay so the call validates.
The event and progress streams send a per-stream jittered retry: once the shared hint hub lands; the earlier note checked a base without it.
The interrupt test drives its fixture by path, which knip cannot follow; mergeStages is used only inside the report module.
yannickmonney
marked this pull request as ready for review
October 9, 2026 06:22
# Conflicts: # services/platform/tests/manual/reference/automation.md # services/platform/tests/manual/suites/performance.md
This was referenced Oct 10, 2026
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.
What
A separate, manually started smoke / stress / performance test of a running Tale deployment:
tools/load(@tale/load, run withnode tools/load/src/cli.ts). Nothing here joins the merge gate; the new Load workflow isworkflow_dispatchonly.mock[[mock:…]]directives; node:cluster for throughput. Deliberately separate from the deterministic e2e gateway.seedrun)/eventsand chat streams, multi-turn chats with TTFT, tasks, uploads + knowledge search, admin chores, the REST API with keys, hostile input. Every route verified against the code.run,merge--shard i/n; HDR histograms per route; Prometheus andpg_stat_statementsbefore/after; thresholds → exit code; JSON + Markdown reports that merge exactly across shards.stack up/down/statusWhy
A million concurrent users cannot be judged by unit tests, and k6-style per-VU runtimes would need terabytes of RAM to hold a million open streams; an async TypeScript harness holds each user in tens of kilobytes and shards across generators. The runs it already enabled found the platform defects fixed in the two companion PRs.
Also
.commitlintrc.jsongains theloadscope; knip, the performance inventory,scripts/performance/README.mdandCONTRIBUTING.mdknow the workspace; the platform's manual performance suite gainsPERF-P16.Review fixes (folded in)
Two adversarial review rounds; each fix is its own commit:
stack upstarts each process in its role (ROLE, which the backend reads), binds the API processes to--hostthrough a newBACKEND_LISTEN_HOST(notHOST: deployments already set that to the public host name), and watches workers through a 5 s settle window so a boot crash fails the stack.retry:(jittered per stream once perf(platform): serve realtime streams from one shared reader per process #4590 lands), else the browser's default.pg_stat_statementsdeltas count a statement once across roles and nesting; the control loop folds only the windows it reads.writes_unheard: task writes whose realtime hint never reached the writer's own stream.Testing
bun run --filter @tale/load typecheck|lint|test— 179 tests (mock wire formats, client, seeder rows, personas against a fake platform, runner, report merge).actionlintclean onload.yml; repo-wide knip clean.