test(wire): extract readServerJSONWithDeadline helper#14
Merged
Conversation
The 10MB cap test inlined a long-deadline websocket read because the existing readServerJSON helper baked in a 2s server read deadline. Extract the deadline-aware variant and have readServerJSON delegate to it, so future slow tests can move large payloads without duplicating the read/decode plumbing. Production code is unaffected; the test rig is not a model of the production path (the production dispatcher has its own ReadTimeout/WriteTimeout). Refs: v0.2-1.8 follow-up from PR #8 deep review Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
blaspat
added a commit
that referenced
this pull request
Jun 6, 2026
…check (#16) Task 1.12 v0.2 cleanup (cherry-picked onto fresh branch from main) — deep review by Claire under Patrick's standing delegation. **Verification on this host:** `bash install/install_layout_test.sh` → 11/11 pass. `shellcheck -x install/install.sh` → clean. **Why this is a fresh PR (not the original PR #15):** the original `feat/1.12-install-scripts` branch carried Phase 1's full history (334e94b was the 1.12 squash target, but the branch had other commits from the original PR-12 push). After #13 and #14 landed on main, the original PR #15 had merge conflicts on README.md + SECURITY-REVIEW.md that would have required a 15-commit rebase to resolve. Cleaner to cherry-pick the single a30ef52 onto a fresh tmp-1.12-harden branch from current main; the diff is identical. **Diff:** 2 files / +33 / -16 - `install/install.sh` — `print_layout` rewritten from a 16-line heredoc to a `jq -n --arg` call - `install/install.ps1` — dropped the always-false `$PSBoundParameters.ContainsKey('Help')` check; comment explains why `[switch]$Help` is intentionally absent Refs PR #12 review comment 4637296237, kanban card `t_7c45d803`.
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.
v0.2-1.8: extract
readServerJSONWithDeadlinetest helperSource: PR #8 deep review comment — #8 (comment)
Diff: 2 files / +22 / -21
internal/wire/dispatch_test.go— extract deadline-aware variant, havereadServerJSONdelegate to itinternal/wire/handler_fs_test.go— drop the inlined 30s read, use the new helperProblem: The 10MB cap test inlined a long-deadline websocket read because the existing
readServerJSONhelper baked in a 2s server read deadline. Full wire test suite takes ~35s (was <1s) because of this one slow test, and the inline read duplicates the read/decode plumbing.Fix: Extract
readServerJSONWithDeadline(t, conn, timeout)as the deadline-aware primitive.readServerJSONbecomes a thin wrapper that calls it with the 2s default. The slow test calls the deadline-aware variant directly. Production code is unaffected; the test rig is not a model of the production path (the production dispatcher has its ownReadTimeout/WriteTimeout).Refs PR #8 review, kanban card
t_73ef352e.