From 0da316038909e5db4f66a10e96b1af04c1a077b4 Mon Sep 17 00:00:00 2001 From: Krishnan Prashanth Date: Tue, 1 Oct 2024 11:10:53 -0700 Subject: [PATCH] Fixing error message substr check --- qa/L0_python_api/test_kserve.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/qa/L0_python_api/test_kserve.py b/qa/L0_python_api/test_kserve.py index 5fda8a271d..f9af5b3b22 100644 --- a/qa/L0_python_api/test_kserve.py +++ b/qa/L0_python_api/test_kserve.py @@ -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)