Skip to content

test(xtask): give policy_all fixtures a per-process sequence number (#10344) - #10478

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/project-thread-qdq5b6-10344-policy-all
Oct 26, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
claude/project-thread-qdq5b6-10344-policy-all

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • xtask/tests/policy_all.rs named each test fixture's temp directory only by pid and wall-clock nanos. Its six tests run in parallel in one process, so two of them can share a directory.
  • On hosted Windows (job 121247689755), two tests' git init raced in one directory and failed with fatal: cannot copy '…/templates/hooks/applypatch-msg.sample' … File exists. The failing rows were ci_policy_collects_real_cheap_failures_before_expensive_work and policy_all_healthy_fixture_passes_with_original_leaf_reports.
  • The fix adds a per-process AtomicU64 sequence number to the directory name.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: none
Spec: none
ADR: none
Plan item: #10344
Governing issue or accepted claim: #10344
Acceptance delta (one sentence): Parallel policy_all tests can no longer share a fixture directory, which removes the Windows git init "File exists" failures recorded on #10344.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-qdq5b6-10344-policy-all
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): none

Scope

  • xtask/tests/policy_all.rs: a sequence number in the fixture name, with a comment explaining why.
  • changelog.d/10344-policy-all-fixture-collision.md (Internal / CI).

Scope Classification

  • Docs/spec/test-only evidence package

Production delta: none.
Non-goals: the other pid + nanos fixture helpers under xtask/tests, which have not been observed failing. The other #10344 rows: #9688 ACL and #10458 invalid JSON.

Support-tier Impact

None.

Policy Impact

None.

Proof

  • cargo test -p xtask --test policy_all: 6/6 pass.
  • Negative control on Linux, with the clock coarsened to a single value (as_nanos() / 10^12):
    • old naming: 6/6 FAILED;
    • sequenced naming: 6/6 pass.
  • cargo xtask precommit: exit 0.
  • Hosted Windows run requested with windows-ci.

Claim Boundary

This removes a fixture-directory race in a test helper. It does not change the policy commands under test.

Rollback

Revert this PR.

Spec-Test-Code Traceability

Not applicable; this is a test helper only.

Static Language Check

No panic-family calls added.

CI Economics

Default required lane.

Engineering Check

Same idiom as other per-process fixture counters in the repo (NEXT_BASE in hostile_repos.rs).

Gates

cargo xtask precommit passes.


Generated by Claude Code

…10344)

Six parallel tests named their temp fixture only by pid and wall-clock
nanos. On hosted Windows two of them shared a directory and raced two
git inits ("File exists" copying hook templates). With the clock
coarsened to one value, the old naming fails all six tests and the
sequenced naming passes all six.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdRXdT9261qDfiBsZW51xs
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 25, 2026 21:36
@EffortlessSteven EffortlessSteven added the windows-ci Run the advisory Windows lane on a pull request without opting into every full-ci lane. label Oct 25, 2026 — with Claude
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

1 similar comment
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 181 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: b625dc40-c71f-4a84-8a43-3fa8bcec5a94
Commits

Reviewing files that changed from the base of the PR and between 2e954f8 and 5f58698.

Files selected for processing: 2
  • changelog.d/10344-policy-all-fixture-collision.md
  • xtask/tests/policy_all.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@github-actions github-actions 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.

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm the repository test target does not itself force equal timestamps or directly assert distinct fixture paths, so regression detection depends on an external negative control rather than an in-repository invariant test.

Refuted

  • Atomic ordering might still allow two tests to select the same fixture directory.; refuted because: AtomicU64::fetch_add is atomic and each invocation observes a distinct previous counter value; Relaxed is sufficient because the value is used only for uniqueness, not synchronization of other data.
  • The new counter introduces a race or could allocate the same value to parallel fixture constructors.; refuted because: AtomicU64 fetch_add is a unique atomic read-modify-write sequence for the process, and the original failing behavior was two concurrent git initializations sharing one path.
  • The PR broadens its claim to all xtask fixture-directory helpers and therefore requires a repository-wide sibling fix.; refuted because: The changelog and PR claim boundary are explicitly limited to policy_all fixtures; other helpers are a parked scope decision, not a changed-line defect.
  • The patch changes policy command behavior or production code despite being presented as a test-only collision fix.; refuted because: The changed behavior is limited to Fixture::new's temporary-directory name; no production policy route is edited.

Evidence gaps

  • The scheduled cargo-test receipt is still needed to establish the claimed 6/6 pass in the current checkout; the failed ripr run does not provide a correctness witness.
  • Model proof intent was rejected by deterministic validation.
  • Executable confirmation of the six policy_all routes is pending the scheduled late cargo-test receipt; the failed ripr sensor is not itself evidence that this test change is incorrect.
  • Automated evidence is incomplete: ripr failed and the always-on cargo-test receipt was not available in the supplied packet.

Copy link
Copy Markdown
Member Author

The required Rust gates failed at typescript::loop_count_guard::tests::binding_names_skip_defaults_and_keys, with "(a, (" reduction is not bounded. That is a 2 s wall-clock assertion in TypeScript code this PR doesn't touch; this PR only changes an xtask test helper.

Locally the whole test takes about 0.9 s across three runs. No fix exists yet, so I filed #10483 to replace the timer with a work-count bound. I'm re-running once by re-applying merge-ready.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Review of record: head 5f586983fcbc358a1368888a89ae50b23d4c2dfa

Required check: Ripr Rust Small Result succeeded on this head (check run 121317521177). The earlier failure (121305184367) was the unrelated TypeScript wall-clock assertion now tracked in #10483. It passed on the one re-run.

Hosted Windows: windows-advisory job 121307407605 on this head.

Angles reviewed

  • Correctness. Each fetch_add on the process-wide AtomicU64 returns a distinct value, and Relaxed ordering is enough for uniqueness. The new name keeps pid and nanos and adds the sequence number, so names stay unique across processes too.
  • Oracle. With the clock coarsened to one value on Linux, the old naming fails all 6 tests and the sequenced naming passes all 6.
  • Scope. The only change is the temp-directory name in Fixture::new plus a changelog fragment; no policy command changes. The other pid + nanos helpers are listed as a non-goal; none has been seen failing.
  • Bot reviews. Devin found no issues. ub-review refuted every candidate defect. Its open question was whether an in-repo test pins uniqueness: none does, and the negative control above is the evidence. Gemini and CodeRabbit hit their quotas, so those reviews are missing rather than clean.
  • Local: cargo test -p xtask --test policy_all passes 6/6, and cargo xtask precommit exits 0.

Findings: none blocking. Disposition: REVIEW_READY. Merging under the standing merge authority.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit 34e5813 into main Oct 26, 2026
92 of 95 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-qdq5b6-10344-policy-all branch October 26, 2026 00:28
EffortlessSteven added a commit that referenced this pull request Oct 26, 2026
…tch cleanup (#10344) (#10523)

* fix(release): accept Cargo's ripr.exe install-record entry on Windows (#10344)

Cargo's .crates2.json names each installed binary by file name, so a
Windows path install records ripr.exe. validate_install_provenance
compared against the bare name and refused every genuine Windows
packaged install as "installed no ripr binary" (hosted Windows rows
on #10443/#10467/#10478). The check now takes the host EXE_SUFFIX, and
a host-explicit test covers both spellings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdRXdT9261qDfiBsZW51xs

* test(xtask): retry a Windows sharing violation when removing check-pr scratch (#10344)

Hosted Windows failed check_pr_failure_report_replaces_stale_success_report
in cleanup (os error 32) after its oracle passed: a briefly held handle
in the test-owned scratch dir. Cleanup now retries os error 32/33 for
up to five seconds; any other error, or a longer holder, still fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdRXdT9261qDfiBsZW51xs

* docs(release): keep validate_install_provenance's doc block on its function

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdRXdT9261qDfiBsZW51xs

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready windows-ci Run the advisory Windows lane on a pull request without opting into every full-ci lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants