Fix macOS and Windows CI: prevent parallel test temp-dir collisions in unique_temp_repo_dir#24
Merged
Merged
Conversation
Harden resolve flow and improve TUI branch selection
added large integration tests and updated readme
readme for humans, by humans
re-relase 0.5 after package moderation
icon cdn, remove obsolete scripts
I've been on a 10-hour train-ride with lots of ☕ and 🤖
…arallel test collisions
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job Build (macOS)
Fix macOS CI: prevent parallel test temp-dir collisions in unique_temp_repo_dir
Jun 5, 2026
Owner
|
@copilot now the Windows tests are failing. All Actions must pass successfully. |
Contributor
Author
Fixed in 58de74d. On Windows, |
Copilot
AI
changed the title
Fix macOS CI: prevent parallel test temp-dir collisions in unique_temp_repo_dir
Fix macOS and Windows CI: prevent parallel test temp-dir collisions in unique_temp_repo_dir
Jun 5, 2026
mwallner
added a commit
that referenced
this pull request
Jun 6, 2026
Merge pull request #24 from mwallner/copilot/fix-build-macos-failure Fix macOS and Windows CI: prevent parallel test temp-dir collisions in unique_temp_repo_dir
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.
The "Build (macOS)" CI job was failing because parallel unit tests could collide on the same temporary directory path, causing
git init --bareto fail withFile existswhen copying templates into an already-initialized repo.Root cause
unique_temp_repo_dir()usedSystemTime::now().as_nanos() + pid— but all test threads share the same PID, and macOS system clock resolution can be coarser than 1 ns, so two concurrent calls could produce identical paths.add_origin_remote_with_feature()calls this twice per test; withbranch_exists_anywhere_finds_remote_only_branchandbranch_exists_anywhere_returns_false_for_truly_missing_branchrunning in parallel, one would win thegit init --bareand the other would error.Changes (
tests/test_helpers.rs)Atomic counter replaces
SystemTime+ PID — anAtomicU64incremented per call guarantees uniqueness regardless of timing or concurrency.Canonicalize temp dir base (non-Windows only) to resolve the macOS
/var→/private/varsymlink before constructing the path, preventing Homebrew git from encountering unexpected path aliasing during template copying. The canonicalize step is skipped on Windows becausePath::canonicalize()there converts paths to the\\?\C:\...extended-length UNC format, which git rejects as an invalid hostname when used as a local remote URL and cannot resolve as a worktree path.