Skip to content

test(windows): keep ACL subprocess work out of cache and registration assertions - #7358

Merged
lidge-jun merged 1 commit into
devfrom
fix/ci-flake-root-causes-2-89
Oct 19, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/ci-flake-root-causes-2-89

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two intermittent Windows CI failures came from ACL subprocess work landing inside a test's assertion window. Neither one is a product bug.

  • policy-only API writes refresh warm estimate, summary and aggregate caches; reset restores catalog (Windows shard 5/9, run 39209343468, Expected: "unchanged"). startServer → loadConfig → hardenConfigDir starts an unawaited icacls directory harden. Its /inheritance:r + inheritable grant rewrites the inherited ACEs on usage.jsonl, which moves the file's NTFS ChangeTime. The aggregate cache deliberately rebuilds on any same-size revision change, so the first stage sees "rebuild". The log shows the failure ~300 ms after server start, inside the first stage. The test now drains that flight with flushConfigDirHardeningAndReaps(home) before asserting warm-cache reuse. Later directory hardens either hit a compliant ACL, which only reads, or finish synchronously before the next summary rebuilds.
  • AUTH-11: cross-process duplicate registration into A/B admits exactly one credential (Windows shard 1/9, nightly 39154486082, Anthropic registration completion deadline exceeded at 16.8 s). The parent's 15 s completion timer starts after both writers report ready, and it also covers each writer's icacls work: secret hardening inside saveCredentialWithReceipt, plus flushConfigDirHardeningAndReaps before exit. Each step has a 30 s budget. The writer fixture now turns the ACL platform gate off before importing the store, so the deadline measures registration admission only. The real processes, the cross-process store lock, atomic publication and duplicate detection are unchanged. ACL policy keeps its own suites (tests/windows/windows-secret-acl.test.ts).

No timeout, retry or skip was changed.

Verification

  • bun test tests/server/model-costs-pricing-cache.test.ts -t policy-only: 40/40 passes, 8 parallel, under 6× yes CPU load (macOS).
  • bun test tests/oauth/oauth-anthropic-instance-multiprocess.test.ts -t AUTH: 40/40 passes, same load.
  • bun run typecheck, bun run structure:check: pass.
  • The Windows cause cannot run on macOS. During read-only investigation, an in-memory probe forced the Windows ACL branch with an injected asynchronous ACL delay. Without the drain or gate it reproduced both failures: rebuild → rebuild for the cache case, and the exact completion deadline exceeded error for AUTH-11 while both result files already held ["success","duplicate"]. With the change, both pass. Windows confirmation is left to the lane=all dispatch.
  • Independent review (gpt-6.1-sol and gemini-4-argon): no blocking findings. Argon traced both paths and confirmed that mid-loop PUTs harden synchronously and that the writer fixture shares the store's ACL module instance.
  • Full suite not run locally. This PR changes only two test files, and the focused stress loops cover them.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test-only; none needed.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (The ACL gate is changed only inside a synthetic-credential test fixture.)

… assertions

The pricing-cache case asserted warm-cache reuse while startServer's
unawaited config-dir ACL harden was still rewriting inherited ACEs; on
NTFS that moves usage.jsonl ChangeTime and the aggregate cache correctly
rebuilds. Drain the flight first.

AUTH-11 billed each writer's icacls work (registration hardening plus
the exit drain, 30 s budget each) to the parent's 15 s registration
deadline. ACL policy has its own suites; the fixture now pins the ACL
platform gate off.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 19, 2026 07:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T07:23:06.204191Z dfb5f5a 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.

@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 Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 554e835d-826c-4438-b872-0f1e30814dba
📥 Commits

Reviewing files that changed from the base of the PR and between 718692b and dfb5f5a.

📒 Files selected for processing: 2
  • tests/fixtures/oauth-anthropic-instance-writer.ts
  • tests/server/model-costs-pricing-cache.test.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.

📝 Walkthrough

The OAuth fixture sets the secret-ACL test platform to Linux before importing the store. The pricing-cache test waits for config-directory hardening and reap work after starting the server and before its cache assertions.

Changes: OAuth fixture platform

Layer / File(s) Summary
Set fixture test platform
tests/fixtures/oauth-anthropic-instance-writer.ts
The fixture sets the secret-ACL test platform to Linux before importing the store. This excludes Windows ACL subprocesses from the cross-process registration timing.

Pricing-cache test synchronization

Layer / File(s) Summary
Wait before cache assertions
tests/server/model-costs-pricing-cache.test.ts
After starting the server, the test awaits flushConfigDirHardeningAndReaps for home before the cache assertions. The added comments describe Windows ChangeTime and aggregate-cache context.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to dfb5f

This change only adjusts two tests to avoid Windows timing interference and does not touch production behavior. No concrete merge-blocking risk was identified. The author reports that Windows confirmation is still pending the lane=all dispatch.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preventing Windows ACL subprocess work from affecting cache and registration assertions.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 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

Comment @coderabbitai help to get the list of available commands.

@lidge-jun
lidge-jun merged commit cb669ee into dev Oct 19, 2026
32 of 35 checks passed
@lidge-jun
lidge-jun deleted the fix/ci-flake-root-causes-2-89 branch October 19, 2026 07:25
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