Skip to content

Commit 73c67b1

Browse files
committed
Test case
1 parent ace2c5b commit 73c67b1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

qa/L0_backend_python/test.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,54 @@ and shared memory pages after starting triton equals to $current_num_pages \n***
407407
exit 1
408408
fi
409409

410+
411+
# Test model with non-existent model file
412+
# The model.py file is intentionally not created to trigger the failure.
413+
rm -fr ./models
414+
mkdir -p models/non_existent_model/1
415+
cp ../python_models/identity_fp32/config.pbtxt ./models/non_existent_model/config.pbtxt
416+
(cd models/non_existent_model && \
417+
sed -i "s/^name:.*/name: \"non_existent_model\"/" config.pbtxt)
418+
419+
SERVER_LOG="./non_existent_model_server.log"
420+
CLIENT_LOG="./non_existent_model_client.log"
421+
ERROR_MESSAGE_1="Failed to preinitialize Python stub: Python model file not found in './models/non_existent_model/1/model.py'"
422+
ERROR_MESSAGE_2="failed to load 'non_existent_model'"
423+
424+
prev_num_pages=`get_shm_pages`
425+
run_server
426+
if [ "$SERVER_PID" != "0" ]; then
427+
echo -e "*** FAILED: unexpected success starting $SERVER" >> $CLIENT_LOG
428+
RET=1
429+
kill_server
430+
else
431+
if grep -q "$ERROR_MESSAGE_1" $SERVER_LOG; then
432+
echo -e "Found \"$ERROR_MESSAGE_1\"" >> $CLIENT_LOG
433+
else
434+
echo -e "Not found \"$ERROR_MESSAGE_1\" in $SERVER_LOG" >> $CLIENT_LOG
435+
cat $SERVER_LOG >> $CLIENT_LOG
436+
RET=1
437+
fi
438+
439+
if grep -q "$ERROR_MESSAGE_2" $SERVER_LOG; then
440+
echo -e "Found \"$ERROR_MESSAGE_2\"" >> $CLIENT_LOG
441+
else
442+
echo -e "Not found \"$ERROR_MESSAGE_2\" in $SERVER_LOG" >> $CLIENT_LOG
443+
cat $SERVER_LOG >> $CLIENT_LOG
444+
RET=1
445+
fi
446+
fi
447+
448+
current_num_pages=`get_shm_pages`
449+
if [ $current_num_pages -ne $prev_num_pages ]; then
450+
cat $SERVER_LOG
451+
ls /dev/shm
452+
echo -e "\n***\n*** Test Failed. Shared memory pages where not cleaned properly.
453+
Shared memory pages before starting triton equals to $prev_num_pages
454+
and shared memory pages after starting triton equals to $current_num_pages \n***"
455+
exit 1
456+
fi
457+
410458
# Disable env test for Jetson since cloud storage repos are not supported
411459
# Disable ensemble, io and bls tests for Jetson since GPU Tensors are not supported
412460
# Disable variants test for Jetson since already built without GPU Tensor support

0 commit comments

Comments
 (0)