Repository navigation
test(worktrees): wait for commands before checkout operations - #483
Merged
Merged
Conversation
This was referenced Nov 13, 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.
The alias-checkout test can observe
threadReady/idlebefore thecreateThreadcommand acknowledgment is persisted. Its final branch switch can therefore correctly fail with “A thread is using this directory.” This is a fixture readiness race: holding that acknowledgment reproducedidlewith a pending command and the exact refusal; releasing it allowed the switch. No product lock remained held after settlement.Add a shared fixture wait for idle, terminal turns and acknowledged admission commands, including checkout aliases without a worktree ID. Also wait for the worktree inventory to stop reporting busy and, for managed worktrees, provide a scan status. Reuse it in tree setup, branch switching, lifecycle/automation cleanup and local/linked external-worktree adoption. Poll only observations; branch-switch and post-delete/settings cleanup assertions remain direct, with no sleeps or mutation retries.
Validation:
thread-branches.test.ts, sequential file runs: unchanged baseline 30/30; final version 30/30 (8 tests per run). The natural flake did not reproduce in the baseline; the acknowledgment-gated diagnostic reproduced its failure window. An earlier implementation also passed 30/30 before the external-worktree scan condition was corrected.bun run typecheck,bun run lint,bun run format:checkandgit diff --checkpassed.check:tmp, generation checks and web build were not run locally in this focused verification scope.Based on
devafter #482 merged. CI evidence: https://github.com/itsoltech/canopy/actions/runs/42792779962/attempts/1Related: #481
Related: #482