Skip to content

[WRONG BRANCH] test: isolate provider fixture DNS and bound child lifetime - #1

Closed
Hylouis233 wants to merge 1 commit into
review/upstream-dev-e0af52c8-20261002from
fix/provider-fixture-isolation-20261002
Closed

Hylouis233 wants to merge 1 commit into
review/upstream-dev-e0af52c8-20261002from
fix/provider-fixture-isolation-20261002

Conversation

@Hylouis233

@Hylouis233 Hylouis233 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Make the provider-outbound loopback fixture independent of host DNS retry timing. Install an isolated ENOTFOUND seam for its four intentionally invalid names, while keeping real destination-policy classification and real proxy/direct HTTP transport.
  • Bound the fixture subprocess to 12 seconds with SIGKILL and preserve upstream's existing awaited cleanup. All prior transport, redirect-sanitization, model-discovery, NO_PROXY, request-count and warning assertions remain; the case deadline stays at 15 seconds. Add the exact DNS lookup sequence assertion.
  • Adapt only the two-file test residue from commit 90eb461 onto upstream dev e0af52c. No production runtime or watchdog default changes.
  • This is a fork-only review draft against an exact upstream snapshot branch, so the diff is two files rather than the stale fork dev/main history. The snapshot branch is a review baseline, not an integration destination. Any upstream submission should target lidge-jun/opencodex:dev after separate review. The inherited dev-only target gate may intentionally flag this fork staging base.

Verification

Linux, project-pinned Bun 1.4.0; dependency lock preserved, install scripts disabled, test environment stripped of provider credentials, fresh isolated homes, and loopback/mocked transports only.

  • bun test --isolate --parallel=1 ./tests/providers/provider-outbound.test.ts: 39 passed, 203 assertions.
  • bun test --isolate --parallel=1 ./tests/routing/destination-policy-resolved.test.ts ./tests/lib/pinned-http.test.ts ./tests/lib/pinned-http-content-coding.test.ts ./tests/server/proxy-env.test.ts ./tests/lib/provider-egress.test.ts ./tests/providers/provider-egress-outbound.test.ts ./tests/test-layout.test.ts ./tests/test-layout-tooling.test.ts ./tests/ci-workflows/file-size-ratchet.test.ts: 174 passed, 1 Windows-only skip, 996 assertions.
  • node node_modules/typescript/bin/tsc --noEmit: passed, using the frozen-lockfile TypeScript version.
  • bun scripts/privacy-scan.ts: passed.
  • git diff --check: passed. The exact tested tree is 74e81e00396c43b0c8767f3be765b51d40f73d13.
  • Controlled DNS fault injection: a separate local harness replaces lookup with four 4,000 ms ENOTFOUND rejections. Unmodified upstream exceeds the existing 15-second budget; this patch completes the same fixture in 0.38 seconds and records exactly the four expected names.
  • Controlled stuck-child fault injection: an extracted copy of this test body runs an inert child that ignores SIGTERM. Upstream hits the 15-second case timeout and the observer still finds the child sleeping (the harness then kills it). This patch reports exit 137 at 12.26 seconds, executes awaited cleanup, and leaves no child. The injected scenario intentionally fails its success assertion; the success criterion is bounded termination and reaping.

The full suite was not run locally: the repository-wide run was disproportionate for this two-file harness-only staging draft in a shared sandbox. The generic wrapper also tries to bootstrap unrelated GUI dependencies, so local focused tests use the direct runner with the repository's normal preload.

Exact-head Cross-platform CI run 37034498379 completed successfully for 7f7719e: all four Linux test shards, aggregate ci, gates, Docker smoke, storage/API checks and Ubuntu/Windows keyring smoke passed. React Doctor and PR hygiene also passed. Native Windows/macOS test shards were skipped by the existing CI scope rules; they remain unverified for this patch.

The separate enforce-target gate reports only the expected review-baseline branch-name mismatch. This draft deliberately preserves the two-file review diff; do not retarget it to stale fork dev or treat it as an integration PR.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (test-harness-only; none needed).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (no production changes; real destination policy and existing assertions preserved).

Forward-port the test-only residue from 90eb461 onto current upstream dev.
Keep real destination-policy and loopback HTTP transport, and retain every
existing transport assertion plus the 15-second case deadline. Install a
child-local DNS failure for the four fixture hostnames and assert all lookups.

Bound the fixture child at 12 seconds with SIGKILL and retain upstream's
existing awaited cleanup. Controlled delayed-DNS and hung-child comparisons
reproduce the current failure and confirm the scoped fix on Linux.
@github-actions github-actions Bot added the chore label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title test: isolate provider fixture DNS and bound child lifetime [WRONG BRANCH] test: isolate provider fixture DNS and bound child lifetime Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (review/upstream-dev-e0af52c8-20261002); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant