Skip to content

A missing run scratch dir is reported as the test file failing to source #1163

Closed

Description

@Chemaclass

Problem

load_test_files sources each file as:

source "$test_file" 2>"$_BASHUNIT_RUN_OUTPUT_DIR/source_err"

If the run's scratch directory is missing, the redirect fails. Bash reports
that as the command failing, so the runner sees exit 1 with nothing written to
the capture file and reports:

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

against a file that is complete and valid. The message names the test file,
which is the one thing that is not at fault — it sent three separate
investigations at the fixture in #1137.

Fix

Restore the directory before sourcing, and fall back to /dev/null if even
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.

Scope

This is a robustness fix, not a fix for #1137. I could not reproduce that
flake in twelve isolated Bash 3.0 runs (six with this change, six without), so
whether this mechanism is what hits CI there is unproven. Filed separately for
that reason.

Activity

  1. self-assigned this
    on Aug 13, 2026
  2. Chemaclass commented on Aug 13, 2026

    @Chemaclass
    MemberAuthor

    Done in #1164 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions