Skip to content

test(wire): extract readServerJSONWithDeadline helper#14

Merged
blaspat merged 1 commit into
mainfrom
chore/1.8-followup-deadline-helper
Jun 6, 2026
Merged

test(wire): extract readServerJSONWithDeadline helper#14
blaspat merged 1 commit into
mainfrom
chore/1.8-followup-deadline-helper

Conversation

@blaspat

@blaspat blaspat commented Jun 6, 2026

Copy link
Copy Markdown
Owner

v0.2-1.8: extract readServerJSONWithDeadline test helper

Source: PR #8 deep review comment — #8 (comment)

Diff: 2 files / +22 / -21

  • internal/wire/dispatch_test.go — extract deadline-aware variant, have readServerJSON delegate to it
  • internal/wire/handler_fs_test.go — drop the inlined 30s read, use the new helper

Problem: The 10MB cap test inlined a long-deadline websocket read because the existing readServerJSON helper 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. readServerJSON becomes 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 own ReadTimeout/WriteTimeout).

Refs PR #8 review, kanban card t_73ef352e.

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 blaspat merged commit f3e3117 into main Jun 6, 2026
@blaspat blaspat deleted the chore/1.8-followup-deadline-helper branch June 6, 2026 05:16
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant