Stop the landing test racing the shell's exit - #45
Merged
Conversation
`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
23 tasks
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.
Summary
executor::tests::conformance::landing::a_directory_at_the_destination_fails_the_shell_writefails 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:PUT_FILE_SCRIPTrefuses a directory at the destination in its first four lines, beforecat > "$tmp", so on that path the shell exits without reading stdin.run_landing_scriptis 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
BrokenPipeas 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.stdinis closed explicitly beforewait_with_output, because the paths that do read it sit incatuntil EOF.PUT_FILE_SCRIPTis 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
BrokenPipe, and the changed one passesmod landing's 21 tests pass repeatedly — the explicitdropkeeps the paths that read stdin from hangingcargo 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) andcargo test --features test-support(350 passed) all passCloses #44