Skip to content

Commit c9aaf67

Browse files
committed
[Tests] Fix check for running process to prevent setup failures
If a test causes a server to crash, a pid file with the pid of the crashed server will be left behind. The teardown phase would then fail due to a non-zero return of the ps command when assigning the pid to $PID. This changes the test to skip killing a process that has already exited without failing.
1 parent aef92e0 commit c9aaf67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/XRootD/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function teardown() {
147147
# Kill all processes that created pid files and are still running
148148
for PIDFILE in *.pid; do
149149
test -s "${PIDFILE}" || continue
150-
PID="$(ps -o pid= "$(cat "${PIDFILE}")")"
150+
PID="$(ps -o pid= "$(cat "${PIDFILE}")" || true)"
151151
if test -n "${PID}"; then
152152
kill -s TERM "${PID}"
153153
fi

0 commit comments

Comments
 (0)