Skip to content

fix(runner): survive a missing run scratch dir when sourcing a test file - #1164

Merged
Chemaclass merged 1 commit into
mainfrom
fix/1137-source-redirect-target
Aug 13, 2026
Merged

Chemaclass merged 1 commit into
mainfrom
fix/1137-source-redirect-target

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1163

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 file failing to source:

✗ Error: Source
    Failed to source 'b_test.sh' (exit 1, 52 bytes, no stderr)

against a file that was complete and valid. The message names the test file,
which is the one thing not at fault.

💡 Changes

  • Restore the directory before sourcing, falling back to /dev/null if that is refused — losing one file's stderr capture beats failing the file for a reason that is not its own
  • Acceptance test covering both halves: a run survives the directory disappearing, and a genuine source failure is still reported

Note 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.

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
@Chemaclass Chemaclass added the bug Something isn't working label Aug 13, 2026
@Chemaclass Chemaclass self-assigned this Aug 13, 2026
@Chemaclass
Chemaclass merged commit af24278 into main Aug 13, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1137-source-redirect-target branch August 13, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant