Skip to content

test(proxy): isolate transfer module loading mocks - #4631

Draft
thymikee wants to merge 1 commit into
mainfrom
t3/fix-proxy-timeout-response
Draft

thymikee wants to merge 1 commit into
mainfrom
t3/fix-proxy-timeout-response

Conversation

@thymikee

@thymikee thymikee commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Move the two transfer-module loading cases into an isolated test file. Change 2 files. Keep all 21 cases, the 10 ms operator cap, and all response assertions. Scope remains proxy tests.

The failure is test isolation. During the failed timeout case, proxyErrorResponse imported the preceding test's throwing Vitest mock. The listener received transfer mechanics loaded and destroyed the socket. Production code does not change.

Closes #4629.

Validation

Tested head: b88e4e182bb2de7ba8fbdd8115ae127cc156bc3f.
Base: fce2fa6247c5287cfabaaeeabfda9ab946f881ff.

  • Install and build passed.
  • pnpm exec vitest run --project unit-core packages/proxy/src/daemon-proxy-transfer.test.ts --coverage reproduced socket hang up on base, run 2. Focused coverage used no reporter and zero global coverage thresholds.
  • At head, the same suite plus the isolated loading file passed 50/50 normal runs and 50/50 coverage runs. Each run passed all 21 cases. No retries.
  • pnpm format passed.
  • pnpm check:affected --run --head b88e4e182bb2de7ba8fbdd8115ae127cc156bc3f failed with exactCommit: true. Format passed. Lint failed: scripts/layering/package-boundaries.test.ts:1001:4, eslint(max-lines), 1001 lines, limit 1000. Fresh unchanged-base pnpm lint failed identically. Remaining selected checks did not run. Owner: layering package-boundary tests. This draft is base-blocked.
  • Full hosted coverage remains required. Independent review remains required; the implementation agent reviewed the diff.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.35 MB 6.35 MB -18 B
Package (unpacked) 6.35 MB 6.35 MB -18 B
Package (download) 1.93 MB 1.93 MB -4 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 33.5 ms 26.2 ms -7.3 ms
CLI --help 72.1 ms 57.7 ms -14.3 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (fce2fa6247c5).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at b88e4e1: it only moves the two transfer-module loading cases into an isolated proxy test file, with the same cases and assertions, and there are no conflicts. The Lint, Typecheck & Package failure is main's max-lines breakage in scripts/layering/package-boundaries.test.ts (1001 lines, also red on main at fce2fa6), which this diff does not touch; #4630 fixes it, and a rebase or re-run after that should go green. It is still a draft, so please mark it ready for review when you want it labeled.

This branch has not been deployed

No deployments
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.

Flaky test: daemon-proxy-transfer 'explicit operator cap' fails with socket hang up

1 participant