Skip to content

test(link): fake Windows ACL and identity lookups in route-intent child fixtures - #8726

Closed
lidge-jun wants to merge 2 commits into
devfrom
fix/dev-red3-route-intent-timeouts
Closed

lidge-jun wants to merge 2 commits into
devfrom
fix/dev-red3-route-intent-timeouts

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Windows shards of two dev batches timed out in the route-intent tests added by #8416 (f23910ab2d):

Affected cases include tests/clients/route-intent-connected.test.ts (40 s each; "connect inherits non-native intent…", "explicit provisioning selection survives…", "local off persists across sync…", "promoted public aliases preserve file ids…" and others) and tests/clients/route-intent-file-originals.test.ts ("a local opt-out of a pre-owned integration…"). In tests/clients/route-intent-runtime-stop.test.ts, the assertion passed and then a cleanup hook timed out; the 480 s batch timeout followed. Even the passing Windows cases took 23–39 s.

Each scenario spawns a Bun child that writes config, lifecycle and link state without installing the ACL fakes the parent tests use. On Windows every such write runs real icacls hardening and principal lookups. With a Windows ACL path injected on Linux, one connected scenario issued 198 ACL commands (120 on the config directory, 72 on the lifecycle database, 6 on link paths) before hitting its 40 s subprocess timeout. A slow asynchronous ACL runner reproduced the runtime-stop cleanup hang, with config-dir-acl-harden still pending.

tests/helpers/route-intent-acl-fixture.ts installs the synchronous and asynchronous icacls fakes and a Windows principal fake, the same seams other fixtures use, and each child calls it before any config write. Assertions and timeout budgets are unchanged; no product behavior changed.

Verification

  • With Windows ACL cost injected on Linux: "connect inherits non-native intent" timed out at 40.06 s before and passes in 2.17 s after. The runtime-stop cleanup timed out before and finishes in 195 ms after.
  • bun test tests/clients/route-intent-connected.test.ts tests/clients/route-intent-file-originals.test.ts tests/clients/route-intent-runtime-stop.test.ts: 34 pass, 0 fail. bun run typecheck: exit 0. bun run test:changed: 34 pass, 0 fail.
  • NOT RUN: a native Windows runner (next dev batch), and the full suite.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated route-intent test scenarios to use a consistent access-control fixture, helping them run reliably across connected, file-originals, and runtime-stop cases.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 23:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T23:59:37.023873Z d05867a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a shared route-intent ACL fixture and installs it in three route-intent tests before their scenarios run.

Changes: Route-intent ACL test fixture

Layer / File(s) Summary
Configure and install the ACL fixture
tests/helpers/route-intent-acl-fixture.ts, tests/clients/route-intent-connected.test.ts, tests/clients/route-intent-file-originals.test.ts, tests/clients/route-intent-runtime-stop.test.ts
The helper configures successful ICACLS results and a fixture Windows identity. The three tests install the fixture before scenario setup or dependency loading.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Merge Risk: Minimal · up to d0586

This test-only change speeds up route-intent tests by faking Windows ACL and identity lookups in child processes. It does not change product behavior, and no concrete merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Windows ACL (icacls) and principal identity lookups are faked in the test child fixtures for route-intent tests. The raw summary confirms the new helper installs ICACL…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Windows ACL (icacls) and principal identity lookups are faked in the test child fixtures for route-intent tests. The raw summary confirms the new helper installs ICACLS runners and Windows principal runners, and the three test files import it. The title is specific, follows the conventional test(scope) format, and matches the PR objectives, which report that real Windows ACL and principal lookups caused timeouts.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 873ec9b and d05867a.

Files selected for processing: 4

  • tests/clients/route-intent-connected.test.ts
  • tests/clients/route-intent-file-originals.test.ts
  • tests/clients/route-intent-runtime-stop.test.ts
  • tests/helpers/route-intent-acl-fixture.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 14, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Closing as superseded. The route-intent scenario children now import via #8707 (696c7b5), which removes the real Windows ACL process cost this PR targeted. The afterAll timeout turned out to have a different cause, fixed by #8710 (e3d4694): did not stop the local-credential observer, whose handles blocked sandbox deletion on Windows. Maintainer judgment: close without merging. This branch conflicts with dev and would add a second ACL helper.

@lidge-jun lidge-jun closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant