Repository navigation
test(gateway): speed up large-buffer assertions - #154351
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 2:31 PM ET / 18:31 UTC (Revision 3). ClawSweeper reviewWhat this changesReplaces two Gateway test buffer comparisons with Node’s native assertions to reduce execution time and memory while preserving exact-byte checks. Merge readiness✅ Ready for maintainer review The refreshed review found no actionable defects on the unchanged head. This remains useful, narrowly scoped work that is absent from fetched main and is protected from cleanup by maintainer context. Priority: P3 Review scores
Verification
How this fits togetherGateway attachment parsing converts uploaded content into managed media, while workspace staging restores worker-produced files from Git. These tests verify the resulting bytes and retain checks for bounded reads, permissions, corruption rejection, and cleanup. flowchart LR
A[Uploaded attachment fixture] --> B[Attachment parser]
B --> C[Decoded media bytes]
D[Worker workspace fixture] --> E[Git staging and restoration]
E --> F[Restored file bytes]
C --> G[Native exact-byte assertions]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the full-size regression fixtures and use native exact-byte comparisons without changing production behavior or weakening surrounding assertions. Do we have a high-confidence way to reproduce the issue? Not applicable to a product bug: this optimizes test execution. The PR reports controlled before/after measurements; this review verified source semantics and exact-head CI without rerunning tests. Is this the best way to solve the issue? Yes. Using the existing Node assertion API preserves full byte comparison and avoids shrinking fixtures, sampling content, or introducing another helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d34acf900f16. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review Please refresh the completed review for unchanged head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* commit '3d4033fbe0aca10c9eec45a7c088540607181d79': (42 commits) fix(windows): prevent update readiness failures on fractional timeouts (#155051) fix(test): await approval readiness and request cleanup (#155111) test(update): preserve published plugin archives in survivor fixtures (#155093) fix(ci): recover security review from inconsistent file lists (#155129) fix(crabbox): skip unused startup and preserve provisioning waits (#154321) fix(qa-lab): refresh Control UI links on URL updates (#152397) fix(maintainer): recover locally refused auto-merge requests (#154988) test(ui): advance debug tray polling with the browser clock (#155091) fix(snapshot): preserve concurrently recovered backups (#155075) fix(anthropic): preserve context-window-limited responses (#155029) fix(ui): stop redundant actions crowding mobile session titles (#154493) test(gateway): compare large buffers with native assertions (#154351) chore(ci): resync pull request head after the Actions incident fix: join local provider child cleanup before releasing ownership fix(test): isolate MXC host environment fixtures fix(test): prevent Windows worker pipe inheritance test(update): use supported reasoning in live survivor probe (#155085) fix(firecrawl): omit impossible publication dates from search results (#155032) fix(sessions): order WAL recovery and join probe release fix(logs): retain severity and subsystem from JSON console records (#153890) ...
What Problem This Solves
Two Gateway tests spend more time deeply comparing 9 MiB buffers than exercising attachment parsing and workspace materialization.
User Impact
No user-visible behavior changes. Both test files finish about twice as fast with lower peak memory.
Why This Change Was Made
Use Node's native exact-byte assertion instead of Vitest's per-byte object comparison. Keep the full 9 MiB inputs, decoded-byte expectations, real Git staging, bounded reads, permissions, corruption checks, and cleanup assertions.
Evidence
Linux Blacksmith Testbox comparisons against
d68811807904, one Vitest worker, A/B/B/A order. Each value below is the mean of the two runs for that version:src/gateway/chat-attachments.test.tssrc/gateway/worker-environments/workspace-result-staging.reads.test.tsThe attachment comparison ran on
tbx_01m30wbrkdtexvewzbcx1phrb7(run); the workspace comparison ran ontbx_01m30xdahk8j0yky1arcs788m6(run). Commands usedpnpm test <file> --maxWorkers=1, including wrapper and collection costs.All 81 focused cases remained unchanged and passed in every comparison. Focused and related policy, MIME, staging-concurrency, and manifest-worker suites passed 105 cases. A temporary mutation of the final decoded PDF byte failed the intended assertion. The selected two-file changed gate passed, including types, formatting, lint, and guards. Independent P2 review is clean. Exact-head CI passed. The attachment file passed 69 cases in 22.05s wrapper wall (19.60s Vitest duration); workspace reads passed 12 in 6.51s wrapper wall (4.62s Vitest duration). These hosted timings are separate from the controlled comparison above.