Uh oh!
There was an error while loading. Please reload this page.
fix(runner): survive a missing run scratch dir when sourcing a test file - #1164
Merged
Conversation
load_test_files sources each file as `source "$file" 2>"$dir/source_err"`. When the run's scratch directory is missing the redirect fails, and bash reports that as the command failing -- exit 1 with nothing written to the capture file. The runner read that as the test file failing to source and printed 'Failed to source (exit 1, 52 bytes, no stderr)' against a file that was complete and valid, naming the one thing not at fault. Restore the directory before sourcing, falling back to /dev/null if that is refused: losing one file's stderr capture is worth far less than failing the file for a reason that is not its own. Not a fix for #1137. That flake did not reproduce in twelve isolated Bash 3.0 runs -- six with this change, six without -- so whether this mechanism is what hits CI there is unproven. Closes#1163
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 freeto 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.
🤔 Background
Related #1163
load_test_filessources each file assource "$file" 2>"$dir/source_err".When the run's scratch directory is missing the redirect fails, and bash
reports that as the command failing — exit 1 with nothing written to the
capture file. The runner read that as the file failing to source:
against a file that was complete and valid. The message names the test file,
which is the one thing not at fault.
💡 Changes
/dev/nullif that is refused — losing one file's stderr capture beats failing the file for a reason that is not its ownNote on #1137
Not a fix for it. That flake did not reproduce in twelve isolated Bash 3.0
runs — six with this change and six without — so whether this mechanism is what
hits CI there is unproven. My earlier reproduction used a harness that shared
one working copy across containers, and I have retracted it on the issue.