fix(migrate): compare owned files, not raw counts, in what_if_mutates_nothing#356
Merged
Conversation
…_nothing `phase_backup` already learned this lesson: on macOS, Spotlight can drop a `.DS_Store` into the tree between two observations, so a raw file-count equality fails spuriously. Its comment even names the symptom — "the 43/44 flake" — and it was hardened to compare by set with an `is_os_transient` exemption. `what_if_mutates_nothing` was never given the same treatment. It still asserts `count_files(&dest) == before`, so the same Spotlight write fails it on macOS with exactly `left: 43, right: 44` and no indication of which path moved. Compare by set, filtered through the same `is_os_transient` exemption. A real mutation now names the offending path instead of printing two integers.
aaronsb
added a commit
that referenced
this pull request
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd::migrate_exec::tests::what_if_mutates_nothingfails intermittently on macOS withassertion left == right failed: what-if must not change the tree / left: 43 / right: 44.This is a known, already-diagnosed flake — just never fixed in this one place.
phase_backupcarries the diagnosis in a comment:phase_backupwas hardened with a set diff plus anis_os_transientexemption.what_if_mutates_nothingstill doesassert_eq!(count_files(&dest), before), so the identical Spotlight write still fails it — with the identical43/44, and with no indication of which path appeared.This applies the same treatment: compare the set of owned files (transients filtered out) before and after. A genuine
what-ifmutation now names the offending path rather than printing two integers.Why now
Surfaced while landing #354 (
ways corpus --verbose), whose macOS CI leg went red on this test. #354 touches onlycorpus.rs,main.rs, and a docs page — nothing that could reachmigrate_exec. Confirmed it's not that PR:main@ portability, dispatched fresh: macOS passescorpus.rs): macOS fails, twiceNondeterministic, macOS-only, and independent of the diff — consistent with Spotlight timing on the runner. Fixing it here, on
main, rather than smuggling it into the diagnostics PR.Test plan
cargo test -p ways -- --test-threads=1— 346 pass, 0 failcargo clippy -p ways --all-targets— no new warnings (count_filesstill used byphase_backup, so no dead-code)