Skip to content

fix(network): run the Bun-runtime gateway check in the integration tier - #10378

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/gateway-tls-test-flake
Nov 24, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/gateway-tls-test-flake

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • gateway.server.test.ts › "routes and verifies TLS under the actual Bun runtime" timed out at the unit suite's 10s on a staging validation (a test shard running 21,831 tests in 452s). It spawns a separate Bun process to prove gateway routing under Bun's own node:net/node:tls shims
  • Timed phase by phase: ~110ms idle. Under 3x CPU oversubscription, median 1.5s, p90 2.2s, worst 9.98s, dominated by Bun boot and module load (median 965ms, worst 7.6s). The child's imports are almost all undici and zod, which are the code under test, so they can't be narrowed. Its own 10s abort timers also matched the test's 10s budget, so a stalled step could never report itself
  • The probe moves to gateway-runtime.integration.ts. Integration files run one at a time with a 30s budget, and the child gets 25s so it fails with its own error first. The child and every assertion are unchanged (4 CONNECTs carrying the gateway token; the fixture's proxy route, signed target, PUT echo and wrong-host rejection)
  • The TLS proxy/origin fixture both files need moves into gateway-tls.test-helpers.ts; the unit file keeps its 15 tests on the same fixture
  • check:egress-boundary skips *.test-helpers.ts fixtures like it already skips test files, and now fails any scanned module that loads a *.test-helpers module, so the skip can't become a path to a transport

Type of Change

  • Bug fix (test)

Testing

  • Unit file 15/15 on 10 runs (and 5/5 under 28 busy loops); integration file 10 runs at 128–199ms (342–880ms under load)
  • Making the proxy stop marking proxied ports turns the integration test red ("Undici bypassed proxy"); restored
  • biome, check:file-names, check:test-patterns, check:unused-exports, cd apps/sim && bun run type-check
  • scripts/check-egress-boundary.test.ts: new case fails with the test-helper rule removed, passes with it; check:egress-boundary passes and flags a probe production import of the fixture

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 24, 2026 9:16pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issues remain.

Summary

Moves the Bun gateway probe into the integration tier and shares its local TLS servers with the unit suite.

  • The Bun gateway check runs in the integration tier.
  • The egress scan blocks production imports of shared test fixtures.

Reviews (3) · Last reviewed commit: "fix(audits): skip test-helper fixtures i..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the fix/gateway-tls-test-flake branch from f2ce360 to 3dbfa4e Compare November 24, 2026 21:09
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 63cfea1 into staging Nov 24, 2026
87 of 88 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/gateway-tls-test-flake branch November 24, 2026 21:35

This branch was successfully deployed

1 active deployment
Preview — 3dbfa4e8 Deployed Nov 24, 2026 by vercel[bot]
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