diff --git a/qa/L0_python_api/test_kserve.py b/qa/L0_python_api/test_kserve.py index 703d86ca43..f9af5b3b22 100644 --- a/qa/L0_python_api/test_kserve.py +++ b/qa/L0_python_api/test_kserve.py @@ -241,11 +241,19 @@ def callback(user_data, result, error): time_out = time_out - 1 time.sleep(1) + # Depending on when gRPC frontend shut down StatusCode can vary + 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 "[StatusCode.UNAVAILABLE] failed to connect to all addresses" - in str(user_data[0]) + and any( + failure_msg in str(user_data[0]) + for failure_msg in acceptable_failure_msgs + ) ) teardown_client(grpc_client)