From 1e31c6dbf5bcb9a428f6a9b117f6b550b848fc9b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 16 Nov 2026 16:12:30 -0800 Subject: [PATCH] test(pjdfstest): check the sudo'd mount with ps, not kill -0 (#12673) sudo switches its real uid to root while it starts, so kill -0 from the invoking user fails with EPERM even though the mount process is alive, and the wait loop reported "weed mount exited early" a few milliseconds after starting it. Co-authored-by: Claude Opus 5.5 --- test/pjdfstest/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/pjdfstest/run.sh b/test/pjdfstest/run.sh index b55e87631a..a9d56dd656 100755 --- a/test/pjdfstest/run.sh +++ b/test/pjdfstest/run.sh @@ -104,7 +104,9 @@ for i in $(seq 1 60); do if mountpoint -q "${MOUNT_DIR}"; then break fi - if ! kill -0 "${mount_pid}" 2>/dev/null; then + # Not kill -0: sudo briefly runs with a root real uid while starting, so + # signalling it fails with EPERM even though it is alive. + if ! ps -p "${mount_pid}" >/dev/null; then echo "weed mount exited early; log tail:" >&2 tail -n 100 "${LOG_DIR}/mount.log" >&2 || true exit 1