From 16d39825d13a861eb394f4c71ea5d1e49903d5a3 Mon Sep 17 00:00:00 2001 From: Yingge He Date: Mon, 13 Apr 2026 20:04:48 -0700 Subject: [PATCH 1/2] Update test --- .../examples/simple_grpc_model_control.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/python/examples/simple_grpc_model_control.py b/src/python/examples/simple_grpc_model_control.py index 3dcbea9d6..006ef1c19 100755 --- a/src/python/examples/simple_grpc_model_control.py +++ b/src/python/examples/simple_grpc_model_control.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2020-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -100,6 +100,32 @@ print("FAILED : Unload Model") sys.exit(1) + # Single path component longer than NAME_MAX must be rejected without + # terminating the server (invalid-arg response, not process abort). + long_path = "file:" + ("A" * 256) + try: + triton_client.load_model( + model_name, + config="{}", + files={long_path: b"a"}, + ) + except InferenceServerException as e: + st = e.status() or "" + if "Invalid file path" not in st: + print( + "FAILED: expected 'Invalid file path' for oversized file path; got {!r}".format( + st + ) + ) + sys.exit(1) + else: + print("FAILED: expected error for oversized file parameter") + sys.exit(1) + + if not triton_client.is_server_live(): + print("FAILED: server not live after rejected load") + sys.exit(1) + # Trying to load wrong model name should emit exception try: triton_client.load_model("wrong_model_name") From 4f52cbb89f62b91e84d1ed2aaf372e00468b0bdd Mon Sep 17 00:00:00 2001 From: Yingge He Date: Thu, 16 Apr 2026 03:15:57 -0700 Subject: [PATCH 2/2] Update test --- src/python/examples/simple_grpc_model_control.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/python/examples/simple_grpc_model_control.py b/src/python/examples/simple_grpc_model_control.py index 006ef1c19..0c5318f9a 100755 --- a/src/python/examples/simple_grpc_model_control.py +++ b/src/python/examples/simple_grpc_model_control.py @@ -110,12 +110,17 @@ files={long_path: b"a"}, ) except InferenceServerException as e: - st = e.status() or "" - if "Invalid file path" not in st: + # TODO: [TRI-958] StatusCode.INVALID_ARGUMENT is more appropriate here + if e.status() != "StatusCode.INTERNAL": print( - "FAILED: expected 'Invalid file path' for oversized file path; got {!r}".format( - st - ) + "FAILED: expected status 'StatusCode.INTERNAL' for oversized file parameter, " + "got status={!r}".format(e.status()) + ) + sys.exit(1) + if "failed to poll from model repository" not in e.message(): + print( + "FAILED: expected 'failed to poll from model repository' for oversized file parameter, " + "got message={!r}".format(e.message()) ) sys.exit(1) else: