Skip to content

Commit aca7c29

Browse files
committed
clear model repro at the start of the test
1 parent e1ad1aa commit aca7c29

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

qa/L0_torch_aoti/test.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export BACKENDS
8080

8181
# Copy the models into the model repository
8282
echo -e "${COLOR_DARK}Setting up model repository in ${MODELDIR}${COLOR_RESET}"
83-
rm -rf ${MODELDIR} && mkdir -p ${MODELDIR}
83+
BAD_MODELDIR=`pwd`/bad_models
84+
rm -rf ${MODELDIR} ${BAD_MODELDIR}
85+
mkdir -p ${MODELDIR}
8486
models=(
8587
"torch_aoti_complex_index"
8688
"torch_aoti_complex_named"
@@ -149,17 +151,12 @@ fi
149151
echo -e "${COLOR_DARK}Killing server (pid: ${SERVER_PID})${COLOR_RESET}"
150152
kill -s SIGINT ${SERVER_PID}
151153
wait ${SERVER_PID} || true
152-
echo -e "${COLOR_DARK}Removing model repository${COLOR_RESET}"
153-
for model in "${models[@]}" "${sequence_models[@]}"; do
154-
rm -rf ${MODELDIR}/${model}
155-
done
156154

157155
# Negative tests: these models declare unsupported types (TYPE_STRING CORRID /
158156
# state) and must fail to load. Start a separate server (exit-on-error=false) so
159157
# it stays up despite the load failures, then assert the models are not ready.
160158
echo -e "${COLOR_DARK}Negative (load-failure) tests${COLOR_RESET}"
161-
BAD_MODELDIR=`pwd`/bad_models
162-
rm -rf ${BAD_MODELDIR} && mkdir -p ${BAD_MODELDIR}
159+
mkdir -p ${BAD_MODELDIR}
163160
bad_models=(
164161
"torch_aoti_sequence_bad_corrid"
165162
"torch_aoti_sequence_bad_state"
@@ -189,7 +186,6 @@ else
189186
kill -s SIGINT ${SERVER_PID}
190187
wait ${SERVER_PID} || true
191188
fi
192-
rm -rf ${BAD_MODELDIR}
193189

194190
# Report results and exit.
195191
if [[ ${RET} -ne 0 ]]; then

0 commit comments

Comments
 (0)