Repository navigation
test: keep drop-in temp workspaces distinct on Darwin - #16568
Conversation
binary_root_alias_refuses_unresolved_intermediate_paths failed on main's
macOS run 46231253682 with [] instead of ["aliased"]. The shared test
helper drop_in::temp_workspace names roots ripr-drop-in-{label}-{pid}-{nanos};
Darwin's clock reports microseconds, so parallel tests with the same label
(the binary-test-alias family uses one label) could share a root and one
test's remove_dir_all deleted the other's manifest. An in-process serial
makes each root unique for all 61 call sites.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmoZMC5G2yepsLm5mr2
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 51 minutes. View limit details
|
|
Independent read of the other failure, kept out of this PR: the raw macOS result records 21,930 passed / 2 failed / 4 ignored. The Git timing test's |
|
macOS proof, run 46235940730 on
Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 33e06a6de1c1220b489e59994df494d869502419 against base 4fba199abc978025f0cbcd808d0463faea632015, by a session that did not write this branch. One file, +5/−1, test-only.
Inspected
crates/ripr/src/analysis/facts/drop_in.rs::temp_workspace(#[cfg(test)]): the root name gains a process-wideAtomicU64serial after the nanosecond stamp.fetch_addhands each call a distinct value, so two calls in one process cannot produce the same name whatever the clock resolution; the pid already separates processes.Relaxedis sufficient because only uniqueness of the returned value matters. No production path changes and the tests keep running in parallel.- Failure being repaired: main run 46231253682, job 141254080028,
test_styles/tests.rs:1744,left: [],right: ["aliased"]. Everybinary_root_alias_*test builds its fixture throughalias_test_names_with_manifestwith the single labelbinary-test-alias, and members of that family write differentapp/Cargo.tomlcontents and remove the root when done. A shared root therefore lets a sibling either delete the manifest or replace it with one that must not credit the alias, and both produce an empty list at that assertion. The mechanism fits the observed value. - The fix sits in the shared helper, so every
temp_workspacecaller gets it rather than this one family.
Evidence read
- macOS run 46235940730 on this exact head, job 141270412047:
running 21939 tests,21934 passed; 1 failed; 4 ignored.binary_root_alias_refuses_unresolved_intermediate_paths ... ok. - The one failure is
python_tests::source_fact_extraction_stays_linear_on_a_large_module(2.30 s to 7.29 s after remeasure). It is a timing ratio on an in-memory parse and does not reachtemp_workspace, so this diff cannot have caused it. It is a separate open item for the lane. - No review threads exist on this PR.
Limits
- The collision is an inference from the code and the failure value; the failing run's directory names were not retained. One passing run of an intermittent test is consistent with the repair and does not prove the cause. The change is correct on its own terms either way, since the old name was not unique by construction.
git::tests::poll_child_returns_promptly_for_a_fast_exiting_child(tracked in #16574): I accept load as the trigger, with one addition. The test takes the best of 20 attempts, and the backoff of 1, 2, 4, 8, 16, 32, 50 ms observes the child at roughly 1, 3, 7, 15, 31 and then 63 ms. A child whose spawn plussleep 0.01runs past about 31 ms cannot be seen under the 50 ms bound, so a loaded runner fails all 20 attempts together instead of occasionally. That is a cliff in the test's bound, worth recording on #16574.- No Linux, Windows or required qualification result exists on this head yet.
Generated by Claude Code
Extract temp_workspace_root and test that two calls with the same label and the same clock value get different roots. Removing the serial makes the test fail on any host, so the repair no longer depends on a macOS run happening to reproduce the collision (Devin review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZMC5G2yepsLm5mr2
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 1f622cc51cbe2360d31ca0e71746cff73464c963, refreshing the review of 33e06a6d for what moved.
What changed since 33e06a6d
One commit, crates/ripr/src/analysis/facts/drop_in.rs only (+23/−8), all under #[cfg(test)].
- The naming moves into
temp_workspace_root(label, nanos), which holds the sameAtomicU64serial and the same format string.temp_workspacereads the clock and calls it, so every existing caller gets an identical name shape to the head the macOS run tested. - New test
temp_workspace_roots_stay_distinct_for_one_timestampcalls the function twice with one label and one fixed timestamp and asserts the roots differ.
Inspected
- The test goes through the function
temp_workspaceactually uses, so it grips the retained path and not a copy of the format string. - It discriminates: without the serial the two names are byte-identical on every host, so the assertion fails on Linux and Windows as well as Darwin. That closes the gap Devin raised, where the earlier head relied on a host clock to exercise the collision.
- Other tests incrementing the same counter in parallel cannot make it pass or fail wrongly, since any two
fetch_addresults differ. - The one review thread (Devin) is replied to and resolved.
Evidence
- macOS run 46235940730 (21,934 passed, 1 failed, 4 ignored; the alias test ok) ran on
33e06a6d. This head differs from it by the refactor and the added test above; no macOS run exists on this exact head, and the new test has not run on a hosted runner yet. - The author reports lib-test clippy clean on this head. I did not build it; the lib test binary does not fit the cloud container.
Limits
- Hosted qualification on this head is the proof for compilation and for the new test.
- The earlier limits stand: the Darwin collision remains an inference from code and the failure value.
Generated by Claude Code
Summary
analysis::facts::test_styles::tests::binary_root_alias_refuses_unresolved_intermediate_paths, which failed on main's scheduled macOS run 46231253682 (job 141254080028). Its assertion read[]where it expected["aliased"].drop_in::temp_workspacenames fixture rootsripr-drop-in-{label}-{pid}-{nanos}. Darwin's clock reports microseconds, so parallel tests with the same label can get the same root. The wholebinary-test-aliasfamily shares one label, so when one test runsremove_dir_allit deletes the other test's manifest, and the alias stays uncredited. The same class hitimported_call_operator_testsin fix(macos): settle zombie-only process groups and clear the native library test failures (#16104) #16149; that run's directory name ended in...000.AtomicU64serial in the root name, which covers all 61temp_workspacecall sites. The tests still run in parallel.git::tests::poll_child_returns_promptly_for_a_fast_exiting_child(54 ms against a 50 ms bound) failed in the same run. It passed in the three previous macOS runs, and this run took 895 s where the last green one took 548 s, so I classify it as runner load, not a source regression.Swarm / Source Boundary
Swarm-only test-helper change.
Source-of-truth Links
Governing issue or accepted claim: #16104 (macOS native lib-test failures; follow-up from the first post-merge main macOS run)
Acceptance delta (one sentence):
binary_root_alias_refuses_unresolved_intermediate_pathsno longer loses its fixture to a same-timestamptemp_workspaceroot collision, and a host-independent test proves two roots with one label and one timestamp differ.Candidate Relationships
Scope Classification
Test-only. No production code changes.
Support-tier Impact
None.
Policy Impact
None.
Proof
The lib-test binary cannot be built in the cloud container, so the hosted macOS run is the behavioral proof.
Claim Boundary
Removes one cause of flaky macOS fixture collisions in tests that use
temp_workspace. Other test helpers that name directories by pid and nanoseconds alone are not changed.Rollback
Revert the commit.
Spec-Test-Code Traceability
crates/ripr/src/analysis/facts/drop_in.rs(test-only helper)Static Language Check
No user-facing text.
CI Economics
One macOS dispatch.
Engineering Check
Smallest change at the shared owner.
Generated by Claude Code