You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d7b945
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service): build service definitions from an injected proxy env, not process.env
The #2107 tests assigned HTTP_PROXY/HTTPS_PROXY/NO_PROXY onto the real
process.env and restored them in a finally. That looked airtight and was not:
`bun test a.test.ts b.test.ts` runs every file in ONE process, and --isolate
does not change that. The values outlived the file.
The Lab sandbox calls rejectProxyEnvironment() against the live process.env and
treats any proxy variable as a harness_failure, by design — it must not dial
out through a proxy. So every Lab file that loaded after service.test.ts died
on a leaked variable it never set: 73 failures on the unsharded macOS lane,
zero when the Lab suites ran alone, which is exactly the shape that makes this
look like flake rather than a defect.
The fix is to stop mutating global state to test a pure function. buildUnit()
and buildPlist() now take the resolved proxy entries as a parameter defaulting
to resolvedProxyEnv(), so production behavior is unchanged and the tests hand
in a literal environment. resolvedProxyEnv() already accepted an env argument;
it is now exported so a test can use it the way the runtime does.
A third case is added while the seam is open: a lower-case http_proxy must be
baked under the canonical upper-case name. That was implemented and documented
but never asserted.
Refs #2107
Verification: the five suites that carried the failure — service, lab-live-probe,
lab-fabric-task, lab-automation, api-key-attribution — go 50 fail -> 0 fail,
236 pass. tsc --noEmit exit 0.
0 commit comments