Skip to content

Avoid waiting for full systest timeout when failing during ar test

Summary

During system tests that print the output of rmcd through tail:

if [[ $VERBOSE == 1 ]]; then
  TEST_PRERUN="tail -v -f /mnt/logs/tpsrv0*/rmcd/cta/cta-rmcd.log & export TAILPID=\$! && ${TEST_PRERUN}"
  TEST_POSTRUN=" && kill \${TAILPID} &> /dev/null"
fi

If the script being run through kubectl fails it will not exit until the call to tail has exited causing the script to get stuck and wait for the global system test timeout when could finish the test much earlier.

echo
echo "Launching client_retrieve.sh on client pod"
echo " Retrieving files: xrdfs as poweruser1"
kubectl -n ${NAMESPACE} exec client -- bash -c "${TEST_PRERUN} && /root/client_retrieve.sh ${TEST_POSTRUN}" || exit 1

What is the expected correct behaviour?

Kill the tail command