test(middleware): benchmark bounded JSON timeout responses - #2332
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Final-head verification at
|
Summary
Closes #2331
Refs #2256 (E-P2-4 only; FileStore and SQLite remain unmeasured).
Adds one benchmark file, no production changes. It serializes the real Hub success envelope and custom-agent model at declared row/prompt sizes (including
config.MaxPageLimit), then compares no timeout, buffered Timeout and TimeoutStream. Status, complete headers and bytes are verified before timing; the timed sink does not retain another response-sized buffer.Measurement / decision
Full methodology, all 90 raw samples, medians and ranges.
Validation
TestTimeout*plus all benchmark cases: Linux-racesmoke passes.-run '^$' -bench '^BenchmarkTimeoutJSONResponses$' -benchtime=1s -count=5 -cpu=1,4 -benchmempasses (90 samples, no race instrumentation).go vet ./internal/middleware, staticcheck 2026.1 andgit diff --checkpass.No database/network workload, live credentials/data, deployment, L3/L4 or concurrent-client throughput claim.