Skip to content

Commit

Permalink
Clarify source of error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Apr 29, 2023
1 parent 38f5bc1 commit f4cbf55
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions qa/L0_trt_error_propagation/trt_error_propagation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,23 @@ def setUp(self):
def test_invalid_trt_model(self):
with self.assertRaises(InferenceServerException) as cm:
self.__triton.load_model("invalid_plan_file")
err_msg = str(cm.exception)
got_err_msg = str(cm.exception)
# "[err_msg]" -> "[triton_err_msg]: [backend_err_msg]: [trt_err_msg]"
backend_err_msg = "Internal: unable to create TensorRT engine: "
expected_backend_err_msg = "Internal: unable to create TensorRT engine: "
self.assertIn(
backend_err_msg, err_msg,
expected_backend_err_msg, got_err_msg,
"Cannot find the expected error message from TensorRT backend")
triton_err_msg, trt_err_msg = err_msg.split(backend_err_msg)
for triton_err_msg_part in [
got_triton_err_msg, got_trt_err_msg = got_err_msg.split(
expected_backend_err_msg)
for expected_triton_err_msg_part in [
"load failed for model", "version 1 is at UNAVAILABLE state: "
]:
self.assertIn(
triton_err_msg_part, triton_err_msg,
expected_triton_err_msg_part, got_triton_err_msg,
"Cannot find an expected part of error message from Triton")
for trt_err_msg_part in ["Error Code ", "Internal Error "]:
for expected_trt_err_msg_part in ["Error Code ", "Internal Error "]:
self.assertIn(
trt_err_msg_part, trt_err_msg,
expected_trt_err_msg_part, got_trt_err_msg,
"Cannot find an expected part of error message from TensorRT framework"
)

Expand Down

0 comments on commit f4cbf55

Please sign in to comment.