Skip to content

test(clipboard): run copy-command stubs through /bin/sh - #683

Merged
DerekMarshall merged 1 commit into
mainfrom
test/clipboard-stubs-via-sh
Oct 15, 2026
Merged

DerekMarshall merged 1 commit into
mainfrom
test/clipboard-stubs-via-sh

Conversation

@DerekMarshall

Copy link
Copy Markdown
Member

Fixes a local flake that failed the rc.4 release-prep gate on macOS: clipboard::tests::copy_via_user_command_splits_on_whitespace_and_args_reach_the_child panicked with read sidecar: NotFound.

Cause: the three copy_via_user_command tests executed a freshly written stub script. macOS scans a file the first time it's executed, and in a loaded parallel run that scan can outlast even the tests' 10-second reap budget. spawn_and_pipe then returns Ok once the payload is in the pipe, as it should for a helper that keeps running, and the test reads a sidecar the stub hasn't written yet.

The other explanations, ruled out from the code:

  • A failed spawn surfaces as an error, which retry_text_busy retries.
  • An inherited pipe keeping the stub's cat waiting would still leave the sidecar, because echo writes it first.

Fix: the three tests name /bin/sh with the stub as its argument (user_command_via_sh). That never executes a new file and still covers the whitespace split, the stdin payload and the exit status. The override-path tests already did this, for the Text file busy race.

Checks:

  • Each of the three still fails when what it covers is broken: argument splitting, the stdin write, and the exit-status check. Each was restored after.
  • make check-ci passes.
  • I couldn't reproduce the stall on demand. The fix removes the mechanism rather than raising the budget.

Generated with Claude Code

The `copy_via_user_command` tests executed a freshly written stub
script. macOS scans a file the first time it is executed, and in a
loaded parallel run that can outlast even the tests' 10s reap budget:
the copy then returns once its text is in the pipe, before the stub has
run, and the test finds no sidecar ("read sidecar: NotFound", seen in
the rc.4 release-prep gate). The three tests now name `/bin/sh` with the
stub as its argument, which never executes a new file and still checks
the whitespace split, the stdin payload and the exit status.

Co-Authored-By: Claude <noreply@anthropic.com>
@DerekMarshall
DerekMarshall merged commit b7d7ed3 into main Oct 15, 2026
4 checks passed
@DerekMarshall
DerekMarshall deleted the test/clipboard-stubs-via-sh branch October 15, 2026 18:47
DerekMarshall added a commit that referenced this pull request Oct 15, 2026
Sets the version to `2.2.0-rc.4`, made with `make release-prep
VERSION=2.2.0-rc.4`. Only `Cargo.toml` and `Cargo.lock` change. As with
the earlier rcs, it gets no CHANGELOG section, because the 2.2.0 section
covers the whole cycle.

## What rc.4 adds over rc.3

| PR | Change |
|---|---|
| #680 / #681 | fix(list): pages are counted from the top, so a `/` jump
always shows the cursor and `l` off a page's last column opens the next
page at its first column (#679). PageDown/PageUp keep the column and
row. |
| #682 | fix(agent-hud): the first column holds its width through every
state, and row headings are bright and bold (#676). |
| #683 | test(clipboard): the copy-command stubs run through `/bin/sh`,
fixing a local macOS flake that failed this release's first prep. |

The owner tested builds of #681 and #682 before they merged. `main`
stays at `2.2.0-rc.4` through the soak.

**After merge, on `main`:**
1. `make release-tag VERSION=2.2.0-rc.4`
2. Push the tag. `release.yml` verifies the archives reproduce,
publishes a GitHub pre-release, and dispatches the Homebrew tap and apt.
The crates job publishes `spyc 2.2.0-rc.4` and skips `spyc-vt-sys
0.1.0`, which is unchanged.

**Checks:** the release-prep commit hook ran `make check` (3,240 tests
passed).

Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant