Repository navigation
test: observe Web response settlement and preserve failure diagnostics - #917
Merged
Merged
Conversation
PR #917: test: observe Web response settlement and preserve failure diagnostics10 files, +324 / -97 Scope🟡 421 lines changed. PRs under 400 receive more thorough review. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static AnalysisOxlint: 1 diagnostic across 1 file (1 rule) no-shadow (1): packages/web/tests/http-client.ts CorrectnessNo extraneous code patterns detected. |
4 tasks done
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.
Why
The diagnostics/navigation slice of #914 makes selected tests observe the response lifetime they name and expose the original evidence when a child process, lockfile comparison, or review component fails. The assertion-correction dependency, #915, is merged into
main.What changes
Before: production response listeners were measured after a scheduler turn, native response settlement was unobserved, and a terminal incomplete raw HTTP response could wait forever. Startup failures discarded captured output, lock mismatches hid process context, and unrelated review errors could satisfy negative assertions.
After: listener acquisition is acknowledged explicitly; real
ServerResponseclose-before-finish and finish-before-close outcomes are observed directly; incomplete terminal HTTP responses fail with the observed termination and a bounded buffered prefix. Failures retain event/count, child command/status/output, and intended error diagnostics. Navigation points to the existing independent runner vectors and actual release-mapping tests. Two demonstrated overlapping pairs are consolidated with their complete assertions retained.What must stay true
settled.length + 1, and exactly one new record after a later explicit append. Both original cases used the identical duplicated-first-record fixture and entrypoint. P1's live post-unwind assertion and independent journal stability remain unchanged.How to verify it
The explicit focused Deno selection passes 44 groups / 161 steps:
deno task test packages/web/tests/server-lifecycle.test.ts packages/web/tests/server.test.ts scripts/tests/shard-execution.test.ts scripts/tests/frozen-entry.test.ts scripts/tests/runtime-tests.test.ts scripts/tests/runtime-exclusions.test.ts scripts/tests/test-file-discovery.test.ts scripts/tests/review-infrastructure.test.ts packages/cli/tests/repl-execution.test.ts packages/code-review-agent/tests/parse-oxlint.test.ts scripts/tests/release-targets.test.tsFocused portable Node and Bun selections pass 97 tests each across Web server/lifecycle, REPL execution, runtime scheduling/exclusions, and discovery. After the final review refinement, Web passes 35 cases under Deno and Node; Bun's full focused selection passes 97/97.
Local delivery checks pass:
deno task lint,deno task check,pnpm exec tsc -p tsconfig.node.json --noEmit, anddeno task check:jsr(Success Dry run complete). Deno and Node typechecks were repeated after the final refinement.Bounded temporary faults discriminate missing finish/close listener removal; close accepted as success; failed finish; late close overriding success; terminal-before-parse; unbounded response prefix; failed child before its startup marker; controlled lock mismatch; unrelated Oxlint exception; missing/extra/reordered/duplicate/empty discovery; and X2 reconstruction append/provider/observer/subsequent-append errors. A delayed-acquisition positive control passes. A listener attachment fault reports its event and numeric counts. Every temporary fault was restored byte-for-byte, with first outputs retained.
Scope
Included: the ten reviewed test/helper/navigation files for this slice of #914. No dependency, public interface, runtime exclusion, CI concurrency, or product-response implementation changes. Packaging fixture ownership and the separate Core/Workflow corrections remain their own slices; this PR does not close #914.
Risks and limitations
Bun reports the real socket reset fixture as
closeon this host. The test retainsresetAndDestroy()as its stimulus, validates the native observed ending, and requires the incomplete-response diagnostic to match it. Initial sandbox loopback/DNS failures and an intermediate refinement error are retained separately from the passing evidence. No flake-frequency or runtime savings are claimed.Architect review: PASS for signed commit
2a7a21469b45f11074ab9528e2b01df5856f9fd8(treea04734a33d78be1694c36efb6f26758efd086d4f).Scope confirmation