Skip to content

Stop the landing test racing the shell's exit - #45

Merged
sehkone merged 1 commit into
mainfrom
sehkone/issue-44
Aug 9, 2026
Merged

Stop the landing test racing the shell's exit#45
sehkone merged 1 commit into
mainfrom
sehkone/issue-44

Conversation

@sehkone

@sehkone sehkone commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

executor::tests::conformance::landing::a_directory_at_the_destination_fails_the_shell_write fails intermittently, and in the harness rather than in what it tests — run 31291172351, 371 passed and 1 failed, on a commit whose earlier runs were green:

panicked at src/executor.rs:2995:22:
write contents: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }

PUT_FILE_SCRIPT refuses a directory at the destination in its first four lines, before cat > "$tmp", so on that path the shell exits without reading stdin. run_landing_script is meanwhile writing the contents and .expect()ing the result. Whether eight bytes reach the pipe buffer before the read end closes decides the test, and nothing about the behaviour under test decides that.

The helper now takes BrokenPipe as one outcome of a run and lets the exit status and stderr the caller already asserts on deliver the verdict; every other write error still panics. stdin is closed explicitly before wait_with_output, because the paths that do read it sit in cat until EOF.

PUT_FILE_SCRIPT is unchanged. Refusing before staging anything is the right order, and reading stdin to be polite about a write being refused would be the wrong repair.

Test plan

  • Reproduced the CI panic locally by sleeping 250ms between the spawn and the write, which loses the race every time: the pre-change helper fails with exactly that BrokenPipe, and the changed one passes
  • With that sleep removed, mod landing's 21 tests pass repeatedly — the explicit drop keeps the paths that read stdin from hanging
  • cargo fmt -- --check --config group_imports=StdExternalCrate, cargo clippy --all-targets -- -D warnings, cargo clippy --all-targets --features test-support -- -D warnings, cargo test (350 passed) and cargo test --features test-support (350 passed) all pass

Closes #44

`PUT_FILE_SCRIPT` refuses a directory at the destination in its first
four lines, before `cat > "$tmp"`. The shell is then gone with the read
end of its stdin closed, while the test helper is writing the contents
and unwrapping the result. Which of the two happens first is a race, and
losing it fails the test with `BrokenPipe` from the harness rather than
from anything the test is about.

The refusal under test is the exit status and the message on stderr. A
write nobody was ever going to read is not part of it, so an early close
is taken as one outcome of a run and every other write error still
panics. The pipe is closed explicitly before the wait, because the paths
that do read stdin sit in `cat` until they see EOF.

Closes #44
@sehkone
sehkone merged commit 7295cc5 into main Aug 9, 2026
4 checks passed
@sehkone
sehkone deleted the sehkone/issue-44 branch August 9, 2026 02:56
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.

Stop the landing test racing the shell's exit

1 participant