mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 00:17:11 +00:00
test: fall back to writable temp files for logs/status in /tmp (#6743)
A fixed /tmp path (log file, final heal status, warp log) can be owned by another user on the shared runner (e.g. a previous root run), which made the github-runner user fail: tee could not append the test log, the final heal status write killed step 6 with EACCES, and upload-artifact could not read stale root-owned warp logs. The heal scenario itself had passed (summary=finished, vm002 reached the target) before the status-save died. - Log files fall back to a unique mktemp path when the configured path is not writable (heal + pool scripts). - The final heal status is written to a mktemp file (best effort). - Workflow artifact uploads use globs for the fallback names.
This commit is contained in:
@@ -1128,6 +1128,12 @@ main() {
|
||||
trap 'rm -f "${ADMIN_API_CODE_FILE}"' EXIT
|
||||
if [ -n "${LOG_FILE}" ]; then
|
||||
mkdir -p "$(dirname "${LOG_FILE}")"
|
||||
if ! touch "${LOG_FILE}" 2>/dev/null; then
|
||||
# A fixed /tmp path may be owned by another user (e.g. a previous root
|
||||
# run); fall back to a unique, always-writable temp file.
|
||||
LOG_FILE="$(mktemp "${TMPDIR:-/tmp}/rustfs-pool-test.XXXXXX.log")"
|
||||
warn "log file not writable; using ${LOG_FILE}"
|
||||
fi
|
||||
exec > >(tee -a "${LOG_FILE}") 2>&1
|
||||
fi
|
||||
if [ "${RESET}" -eq 1 ]; then
|
||||
|
||||
Reference in New Issue
Block a user