From 7c5c96f5ca7fcdf338d0bdc3beb8f9324fa85741 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Wed, 9 Jul 2025 10:40:49 +1200 Subject: [PATCH] Don't use -f for intertask tests... ... if we expect the database to still contain previous runs. Use `rm -rf` to clear directories by hand instead. --- tests/intertask/cancelledby.sh | 16 ++++++++-------- tests/intertask/longrunning.sh | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/intertask/cancelledby.sh b/tests/intertask/cancelledby.sh index 9eb6b41..940cacd 100644 --- a/tests/intertask/cancelledby.sh +++ b/tests/intertask/cancelledby.sh @@ -3,21 +3,21 @@ set -e if [[ $TASK == a ]]; then # different process, no cancellations - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE b - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE c + rm -rf ${WORKDIR}_* + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE a + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE b + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE c test -e ${WORKDIR}_a/PASS -a -e ${WORKDIR}_b/FAIL -a -e ${WORKDIR}_c/FAIL elif [[ $TASK == b ]]; then # same process, a cancels c cancels b # use statusdb so that the different taskloops from using --sequential doesn't matter - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE --statusreset || true python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a c b --sequential --statuscancels test -e ${WORKDIR}_a/PASS -a -e ${WORKDIR}_b/CANCELLED -a -e ${WORKDIR}_c/CANCELLED else # different process, b cancels a, c completes before a - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE --statusreset || true - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE b --statuscancels - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE c --statuscancels - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE a --statuscancels + rm -rf ${WORKDIR} ${WORKDIR}_* + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE b --statuscancels + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE c --statuscancels + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE a --statuscancels echo test -e ${WORKDIR}_a/CANCELLED -a -e ${WORKDIR}_b/FAIL -a -e ${WORKDIR}_c/FAIL fi diff --git a/tests/intertask/longrunning.sh b/tests/intertask/longrunning.sh index cd7902c..3013897 100644 --- a/tests/intertask/longrunning.sh +++ b/tests/intertask/longrunning.sh @@ -4,11 +4,11 @@ set -e if [[ $TASK == bmc ]]; then python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE prove bmc else - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE --statusreset || true - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE bmc --statuscancels & bmc_pid="$!" + rm -rf ${WORKDIR} ${WORKDIR}_* + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE bmc --statuscancels & bmc_pid="$!" # make sure we don't leave the background task running trap 'kill "$bmc_pid" 2>/dev/null || true' EXIT - python3 $SBY_MAIN --prefix $WORKDIR -f $SBY_FILE prove + python3 $SBY_MAIN --prefix $WORKDIR $SBY_FILE prove sleep 10 test -e ${WORKDIR}_bmc/CANCELLED fi