Skip to content
66 changes: 58 additions & 8 deletions qa/L0_backend_python/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ cp ../python_models/identity_fp32/config.pbtxt ./models/non_existent_model/confi

SERVER_LOG="./non_existent_model_server.log"
CLIENT_LOG="./non_existent_model_client.log"
SERVER_ARGS=$BASE_SERVER_ARGS
ERROR_MESSAGE_1="Failed to preinitialize Python stub: Python model file not found in '`pwd`/models/non_existent_model/1/model.py'"
ERROR_MESSAGE_2="failed to load 'non_existent_model'"

Expand Down Expand Up @@ -445,6 +446,52 @@ else
fi
fi

if [ $current_num_pages -ne $prev_num_pages ]; then
cat $SERVER_LOG
ls /dev/shm
echo -e "\n***\n*** Test Failed. Shared memory pages where not cleaned properly.
Shared memory pages before starting triton equals to $prev_num_pages
and shared memory pages after starting triton equals to $current_num_pages \n***"
exit 1
fi

SERVER_LOG="./non_existent_model_server_auto_config_disabled.log"
CLIENT_LOG="./non_existent_model_client_auto_config_disabled.log"
SERVER_ARGS="$BASE_SERVER_ARGS --disable-auto-complete-config"

prev_num_pages=`get_shm_pages`
run_server
if [ "$SERVER_PID" != "0" ]; then
echo -e "*** FAILED: unexpected success starting $SERVER" >> $CLIENT_LOG
RET=1
kill_server
else
if grep -q "$ERROR_MESSAGE_1" $SERVER_LOG; then
echo -e "Found \"$ERROR_MESSAGE_1\"" >> $CLIENT_LOG
else
echo -e "Not found \"$ERROR_MESSAGE_1\" in $SERVER_LOG" >> $CLIENT_LOG
cat $SERVER_LOG >> $CLIENT_LOG
RET=1
fi

if grep -q "$ERROR_MESSAGE_2" $SERVER_LOG; then
echo -e "Found \"$ERROR_MESSAGE_2\"" >> $CLIENT_LOG
else
echo -e "Not found \"$ERROR_MESSAGE_2\" in $SERVER_LOG" >> $CLIENT_LOG
cat $SERVER_LOG >> $CLIENT_LOG
RET=1
fi
fi

if [ $current_num_pages -ne $prev_num_pages ]; then
cat $SERVER_LOG
ls /dev/shm
echo -e "\n***\n*** Test Failed. Shared memory pages where not cleaned properly.
Shared memory pages before starting triton equals to $prev_num_pages
and shared memory pages after starting triton equals to $current_num_pages \n***"
exit 1
fi

# Disable env test for Jetson since cloud storage repos are not supported
# Disable ensemble, io and bls tests for Jetson since GPU Tensors are not supported
# Disable variants test for Jetson since already built without GPU Tensor support
Expand All @@ -461,10 +508,14 @@ if [ "$TEST_JETSON" == "0" ]; then
for TEST in ${SUBTESTS}; do
# Run each subtest in a separate virtual environment to avoid conflicts
# between dependencies.
setup_virtualenv

set +e
(cd ${TEST} && bash -ex test.sh)
(
setup_virtualenv
cd ${TEST} && bash -ex test.sh
deactivate_virtualenv
)

EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Subtest ${TEST} FAILED"
Expand All @@ -477,8 +528,6 @@ if [ "$TEST_JETSON" == "0" ]; then
fi
fi
set -e

deactivate_virtualenv
done

# [DLIS-5969]: Incorporate env test for windows
Expand Down Expand Up @@ -506,18 +555,19 @@ fi
for TEST in ${SUBTESTS}; do
# Run each subtest in a separate virtual environment to avoid conflicts
# between dependencies.
setup_virtualenv

set +e
(cd ${TEST} && bash -ex test.sh)
(
setup_virtualenv
cd ${TEST} && bash -ex test.sh
deactivate_virtualenv
)

if [ $? -ne 0 ]; then
echo "Subtest ${TEST} FAILED"
RET=1
fi
set -e

deactivate_virtualenv
done

if [ $RET -eq 0 ]; then
Expand Down
Loading