Skip to content

test(claude): control ACL time in the concurrent config-edit merge cases - #8629

Merged
lidge-jun merged 1 commit into
devfrom
fix/dev-red-effort-caps-stale-update
Nov 13, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/dev-red-effort-caps-stale-update

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

The macOS dev batch (run 43343080374, macos 1/4) failed tests/claude-integration/claude-config-root-stale-updates.test.ts:64, admitted partial edits merge the latest state: /api/effort-caps, with [200, 500] after 1291 ms. The other four routes passed in 20–80 ms, and earlier macOS batches passed this case in 20–26 ms.

The cases come from #7826. They force the Windows ACL path, set OPENCODEX_ACL_TIMEOUT_MS=1000, and hold both requests at the config-root barrier on the real clock. Both admissions share withWindowsSecretAclSettled's deadline (src/lib/windows-secret-acl.ts), so when the first save is slow on a loaded runner, the second request's one-second budget expires. The handler then answers its ETIMEDOUT as a 500 (src/server/management/agent-settings-routes.ts). These cases test merging under a controlled ACL barrier, not elapsed time. They now freeze the ACL clock (setNowForTests) and disable the belt scheduler (setAsyncIcaclsBeltSchedulerForTests); the existing afterEach already resets both. Timeout refusals keep their own coverage in claude-config-root-late-admission.test.ts. Both 200s and the merged live and disk state assertions are unchanged, and production code is untouched.

Verification

  • Reproduced on Linux by delaying the first save by 1.1 s (temporary instrumentation, not committed): bun test tests/claude-integration/claude-config-root-stale-updates.test.ts -t '/api/effort-caps' gave 0 pass, 1 fail ([200, 500], ETIMEDOUT) before, 1 pass after.
  • bun test tests/claude-integration/claude-config-root-stale-updates.test.ts tests/claude-integration/claude-config-root-late-admission.test.ts: 80 pass, 0 fail.
  • bun run typecheck: exit 0. bun run test:changed: 14 pass, 0 fail.
  • NOT RUN: a macOS runner (PR CI is Ubuntu only; the maintainer's next dev batch covers it), 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
    • Stabilized the concurrent-update test by controlling the clock and ACL completion timing.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 02:49
@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-13T02:51:18.898013Z 9711c28 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 Nov 13, 2026
@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 admitted partial-edit merge test fixes the test clock at zero and disables the asynchronous icacls belt scheduler before testing concurrent updates.

Changes: Claude config stale-update test

Layer / File(s) Summary
Merge test setup
tests/claude-integration/claude-config-root-stale-updates.test.ts
The test sets the clock to zero and replaces the asynchronous icacls belt scheduler with a no-op. Its comment distinguishes ACL completion setup from timeout coverage.

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

Change: Other

Possibly related PRs

  • lidge-jun/opencodex#7826: Gates config save and partial-update writer phases on config-root ACL settlement, which the main PR's tests exercise.

Suggested labels: chore

Merge Risk: Minimal · up to 9711c

This change only adjusts test setup to remove a timing flake in concurrent config-edit tests. It does not touch production code, and no merge-blocking 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 "test(claude): control ACL time in the concurrent config-edit merge cases" matches the main change. The raw summary and PR objectives both say the change freezes the ACL clock with setNowFor…
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 "test(claude): control ACL time in the concurrent config-edit merge cases" matches the main change. The raw summary and PR objectives both say the change freezes the ACL clock with setNowForTests and disables the icacls belt scheduler in the concurrent config-edit tests. The title is specific, under 72 characters, and free of noise. It does not describe production code changes, which the PR says it does not make.

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 6df43d5 and 9711c28.

Files selected for processing: 1

  • tests/claude-integration/claude-config-root-stale-updates.test.ts

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

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment (dev integration, MAINTAINERS.md maintainer-integration exception): merging without a second maintainer approval, as part of the DEV-RED repair for dev batch run 43343080374 (macos 1/4).

  • Exact head: 9711c2835d6d54a5cb8bdc3b6b678a2b16414df6. Every required PR check on this head passed (gates, test changed, hygiene, enforce-target, ci).
  • Fresh independent review on this exact head: VERDICT: PASS, no findings. Its fresh runs: stale-updates and late-admission tests 80 pass / 0 fail, typecheck, structure:check, privacy:scan and file-size ratchet all exit 0.
  • Scope: test-only. Production deadline behavior is unchanged, and timeout refusals keep their own coverage.
  • No outstanding change requests. No security-boundary surface touched.
  • Not yet verified on macOS; the maintainer's next dev batch covers it.

@lidge-jun
lidge-jun merged commit 29be898 into dev Nov 13, 2026
31 checks passed
@lidge-jun
lidge-jun deleted the fix/dev-red-effort-caps-stale-update branch November 13, 2026 03:15
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