Skip to content

Commit ca8ae28

Browse files
authored
test: Refactor core input size checks (#7592)
1 parent a6fff97 commit ca8ae28

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

qa/L0_input_validation/input_validation_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def get_input_array(input_size, np_dtype):
195195
triton_client.infer(model_name=model_name, inputs=inputs)
196196
err_str = str(e.exception)
197197
self.assertIn(
198-
f"expected {input_size} string elements for inference input 'INPUT1', got {input_size-2}",
198+
f"expected {input_size} string elements for inference input 'INPUT1' for model '{model_name}', got {input_size-2}",
199199
err_str,
200200
)
201201

@@ -208,7 +208,7 @@ def get_input_array(input_size, np_dtype):
208208
triton_client.infer(model_name=model_name, inputs=inputs)
209209
err_str = str(e.exception)
210210
self.assertIn(
211-
f"expected {input_size} string elements for inference input 'INPUT1', got {input_size+2}",
211+
f"unexpected number of string elements {input_size+1} for inference input 'INPUT1' for model '{model_name}', expecting {input_size}",
212212
err_str,
213213
)
214214

qa/L0_input_validation/test.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ set +e
6868
python3 -m pytest --junitxml="input_validation.report.xml" $TEST_PY::InputValTest >> $CLIENT_LOG 2>&1
6969

7070
if [ $? -ne 0 ]; then
71-
echo -e "\n***\n*** input_validation_test.py FAILED. \n***"
71+
cat $CLIENT_LOG
72+
cat $SERVER_LOG
73+
echo -e "\n***\n*** input_validation_test.py::InputValTest FAILED. \n***"
7274
RET=1
7375
fi
7476
set -e
@@ -138,7 +140,9 @@ set +e
138140
python3 -m pytest --junitxml="input_shape_validation.report.xml" $TEST_PY::InputShapeTest >> $CLIENT_LOG 2>&1
139141

140142
if [ $? -ne 0 ]; then
141-
echo -e "\n***\n*** input_validation_test.py FAILED. \n***"
143+
cat $CLIENT_LOG
144+
cat $SERVER_LOG
145+
echo -e "\n***\n*** input_validation_test.py::InputShapeTest FAILED. \n***"
142146
RET=1
143147
fi
144148
set -e
@@ -147,19 +151,20 @@ kill $SERVER_PID
147151
wait $SERVER_PID
148152

149153
# input_byte_size_test
154+
cp -r /data/inferenceserver/${REPO_VERSION}/qa_identity_model_repository/{savedmodel_zero_1_float32,savedmodel_zero_1_object} ./models
155+
150156
set +e
151-
LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH $TEST_EXEC >>$TEST_LOG 2>&1
157+
LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH $TEST_EXEC >> $TEST_LOG 2>&1
152158
if [ $? -ne 0 ]; then
153-
echo -e "\n***\n*** Query Unit Test Failed\n***"
159+
cat $TEST_LOG
160+
echo -e "\n***\n*** input_byte_size_test FAILED\n***"
154161
RET=1
155162
fi
156163
set -e
157164

158165
if [ $RET -eq 0 ]; then
159166
echo -e "\n***\n*** Input Validation Test Passed\n***"
160167
else
161-
cat $CLIENT_LOG
162-
cat $SERVER_LOG
163168
echo -e "\n***\n*** Input Validation Test FAILED\n***"
164169
fi
165170

0 commit comments

Comments
 (0)