Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions share/etest/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ $(opt_parse \
# Default values we will override later. These are needed so if we get an assert failure or die failure in arg
# validation they don't fail because of undefined variables.
ETEST_STDERR_FD=2
TEST_OUT="/dev/null"

# Verify --jobs is a valid integer.
assert_int_ge "${jobs}" 0 "jobs must be an integer value greater than or equal to 0"
Expand Down Expand Up @@ -212,16 +211,9 @@ ETEST_RESULTS="${artifact_name}.results.log"
# path-based redirection fails when stderr is a socket (e.g., when running under systemd with journal logging).
if [[ ${silent} -eq 1 ]]; then
exec {ETEST_STDERR_FD}>/dev/null
TEST_OUT="/dev/null"
elif [[ ${verbose} -eq 0 ]]; then
exec {ETEST_STDERR_FD}>&2
TEST_OUT="/dev/null"
elif [[ ${jobs} -gt 0 ]]; then
# Parallel + verbose: test output is captured to logs and replayed via ETEST_STDERR_FD
exec {ETEST_STDERR_FD}>&2
TEST_OUT="/dev/null"
else
# Serial + verbose: test output goes directly to stderr
exec {ETEST_STDERR_FD}>/dev/null
TEST_OUT="/dev/stderr"
# Verbose mode: test output is captured to logs and replayed via ETEST_STDERR_FD
exec {ETEST_STDERR_FD}>&2
fi
4 changes: 2 additions & 2 deletions share/etest/results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ __extract_test_output()
local test_output="${workdir}/${suite}.etest/${name}/output.log"
[[ -f "${test_output}" ]] || return 0

# Strip ANSI codes and output the test content
noansi < "${test_output}"
# Strip ANSI codes and NUL bytes (which cause bash warnings in command substitution)
noansi < "${test_output}" | tr -d '\0'
}

create_failure_output()
Expand Down
8 changes: 7 additions & 1 deletion share/etest/runners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ run_single_test()
__suite_teardown
fi
}

# Include the test's output in the job's output so verbose mode can display it.
# The test redirected its output to testdir/output.log (line 99), so we include it here.
if [[ -f "${testdir}/output.log" ]]; then
cat "${testdir}/output.log"
fi

edebug "Finished $(lval testname display_testname rc)"

# NOTE: Process and mount leak detection is deferred to global_teardown for efficiency.
Expand Down Expand Up @@ -394,7 +401,6 @@ __worker_main()
else
exec {ETEST_STDERR_FD}>/dev/null
fi
TEST_OUT="/dev/null"

# Reset counters and arrays for this job (critical: arrays must be reset to prevent accumulation across jobs)
NUM_TESTS_EXECUTED=0
Expand Down
Loading