Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Refactor core input size checks #7592

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qa/L0_input_validation/input_validation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def get_input_array(input_size, np_dtype):
triton_client.infer(model_name=model_name, inputs=inputs)
err_str = str(e.exception)
self.assertIn(
f"expected {input_size} string elements for inference input 'INPUT1', got {input_size-2}",
f"expected {input_size} string elements for inference input 'INPUT1' for model '{model_name}', got {input_size-2}",
err_str,
)

Expand All @@ -208,7 +208,7 @@ def get_input_array(input_size, np_dtype):
triton_client.infer(model_name=model_name, inputs=inputs)
err_str = str(e.exception)
self.assertIn(
f"expected {input_size} string elements for inference input 'INPUT1', got {input_size+2}",
f"unexpected number of string elements {input_size+1} for inference input 'INPUT1' for model '{model_name}', expecting {input_size}",
rmccorm4 marked this conversation as resolved.
Show resolved Hide resolved
err_str,
)

Expand Down
17 changes: 11 additions & 6 deletions qa/L0_input_validation/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ set +e
python3 -m pytest --junitxml="input_validation.report.xml" $TEST_PY::InputValTest >> $CLIENT_LOG 2>&1

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

if [ $? -ne 0 ]; then
echo -e "\n***\n*** input_validation_test.py FAILED. \n***"
cat $CLIENT_LOG
cat $SERVER_LOG
echo -e "\n***\n*** input_validation_test.py::InputShapeTest FAILED. \n***"
RET=1
fi
set -e
Expand All @@ -147,19 +151,20 @@ kill $SERVER_PID
wait $SERVER_PID

# input_byte_size_test
cp -r /data/inferenceserver/${REPO_VERSION}/qa_identity_model_repository/{savedmodel_zero_1_float32,savedmodel_zero_1_object} ./models

set +e
LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH $TEST_EXEC >>$TEST_LOG 2>&1
LD_LIBRARY_PATH=/opt/tritonserver/lib:$LD_LIBRARY_PATH $TEST_EXEC >> $TEST_LOG 2>&1
if [ $? -ne 0 ]; then
echo -e "\n***\n*** Query Unit Test Failed\n***"
cat $TEST_LOG
echo -e "\n***\n*** input_byte_size_test FAILED\n***"
RET=1
fi
set -e

if [ $RET -eq 0 ]; then
echo -e "\n***\n*** Input Validation Test Passed\n***"
else
cat $CLIENT_LOG
cat $SERVER_LOG
echo -e "\n***\n*** Input Validation Test FAILED\n***"
fi

Expand Down
Loading