Two test-suite flakes fixed at the root, both dependencies on machine
load and concurrent builds.
**Concurrent-cargo spawn `NotFound`.** Cargo uplifts `target/debug/wt`
by removing the path and recreating it, so a second `cargo` against the
same target directory leaves the binary every test spawns absent for a
fraction of a millisecond per rebuild — the one-off `NotFound` spawn
failures that pass on re-run. `wt_bin()` now returns a hardlink pinned
under `target/debug/wt-test-bin/<mtime>-<len>/`: the uplift unlinks only
the uplifted name, so the pin keeps serving the observed binary through
any number of concurrent rebuilds, at no disk cost beyond the `deps/`
artifact whose inode it shares. `test_wt_spawns_are_pinned` keeps every
spawn routed through it. Reproduced by re-creating the uplift every 200
ms alongside a full `cargo nextest run`: 302 of 4583 tests failed before
this change (147 as direct `NotFound` spawn panics, five of them
byte-identical to the original shell-wrapper report), 4585 of 4585 after
— with an unrelated external cargo also rebuilding `wt` mid-validation,
absorbed the same way.
**`--reap` probe races.** `test_remove_reap_kills_process` predicted the
reap guard's verdict with its own `lsof`/`ps` snapshot, and under load
either probe's spawn can stall past the 5 s bound, whose fail-safe empty
result flips the outcome — a prediction `wt` then contradicts, or `wt`
reporting "No processes to reap" for a live child. The prediction now
reads the session's controlling terminal directly (`/dev/tty` opens iff
the session has one — the property the child inherits at spawn), the
probe timeout is env-pinnable (`WORKTRUNK_TEST_PROBE_TIMEOUT_MS`, set to
60 s in the static test baseline; production keeps its 5 s bound), and
the discovery poll uses the suite's 60 s presence-poll convention.
Looped 15/15 green at load average ~60, where the previous shape failed
2/10.
Not covered here, noted as follow-ups: benches still spawn
`env!("CARGO_BIN_EXE_wt")` directly (same hazard, separate runner,
outside the guard's scan), and the reap "spared" branch has no
deterministic end-to-end test (needs a PTY-held child).
> _This was written by Claude Code on behalf of max-sixty_
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* fix: preserve .exe suffix in shell function names on Windows
When invoked as `git-wt.exe`, the shell function is now named `git-wt.exe()`
instead of `git-wt()`. This ensures aliases like `alias gwt="git-wt.exe"`
correctly invoke the shell wrapper.
The fix changes `binary_name()` from `file_stem()` to `file_name()`, and
simplifies the `--source` flag to always use `cargo run --bin wt` since
`wt` and `git-wt` are identical code.
Fixes#348🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: remove unused TestRepo parameter from Windows tests
The shell init command doesn't need a git repo context - it just
generates shell initialization code. Remove the TestRepo parameter
to fix compilation on Windows CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: strip .exe from config lines, keep only in function name
On Windows, binary_name() returns "wt.exe" but the config line written
to .bashrc/.zshrc should use "wt" (without .exe) because:
- MSYS2/Git Bash automatically resolves wt → wt.exe
- Simpler detection (no dual-pattern matching needed)
- Config files look cleaner
The .exe suffix is preserved in the shell function name (in templates)
to match alias expansion - that's the fix for issue #348.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: simplify Windows shell integration by stripping .exe
Instead of preserving .exe in shell function names and stripping it in 6
different places for detection, we now simply strip .exe at the source in
binary_name(). This relies on MSYS2/Git Bash automatically resolving
`wt` to `wt.exe`.
Users should use `alias wt="wt"` instead of `alias wt="wt.exe"`.
The shell function will be `wt()` and MSYS2 handles the PATH resolution.
This significantly simplifies the codebase by removing .exe handling from:
- is_shell_integration_line()
- scan_file()
- config_line()
- config_paths() for Fish
- completion_path()
- scan_for_detection_details()
Issue #348🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: remove git-wt test that requires optional feature
The git-wt binary requires the git-wt feature which isn't enabled in CI.
The wt test is sufficient since both binaries use the same binary_name() logic.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>