Skip to content

Commit

Permalink
Fixing error message substr check
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishnanPrash committed Oct 1, 2024
1 parent 977774b commit 0da3160
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions qa/L0_python_api/test_kserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,18 @@ def callback(user_data, result, error):
time.sleep(1)

# Depending on when gRPC frontend shut down StatusCode can vary
acceptable_failure_msgs = set(
[
"[StatusCode.CANCELLED] CANCELLED",
"[StatusCode.UNAVAILABLE] failed to connect to all addresses",
]
)
acceptable_failure_msgs = [
"[StatusCode.CANCELLED] CANCELLED",
"[StatusCode.UNAVAILABLE] failed to connect to all addresses",
]

assert (
len(user_data) == 1
and isinstance(user_data[0], InferenceServerException)
and str(user_data[0]) in acceptable_failure_msgs
and any(
failure_msg in str(user_data[0])
for failure_msg in acceptable_failure_msgs
)
)

teardown_client(grpc_client)
Expand Down

0 comments on commit 0da3160

Please sign in to comment.