@@ -58,12 +58,13 @@ def setUp(self):
58
58
self ._shm_leak_detector = shm_util .ShmLeakDetector ()
59
59
60
60
def test_batch_error (self ):
61
- # The execute_error model returns an error for the first request and
62
- # sucessfully processes the second request. This is making sure that
63
- # an error in a single request does not completely fail the batch.
61
+ # The execute_error model returns an error for the first and third
62
+ # request and sucessfully processes the second request. This is making
63
+ # sure that an error in a single request does not completely fail the
64
+ # batch.
64
65
model_name = "execute_error"
65
66
shape = [2 , 2 ]
66
- number_of_requests = 2
67
+ number_of_requests = 3
67
68
user_data = UserData ()
68
69
triton_client = grpcclient .InferenceServerClient ("localhost:8001" )
69
70
triton_client .start_stream (callback = partial (callback , user_data ))
@@ -83,7 +84,7 @@ def test_batch_error(self):
83
84
84
85
for i in range (number_of_requests ):
85
86
result = user_data ._completed_requests .get ()
86
- if i == 0 :
87
+ if i == 0 or i == 2 :
87
88
self .assertIs (type (result ), InferenceServerException )
88
89
continue
89
90
@@ -139,7 +140,8 @@ def test_incorrect_execute_return(self):
139
140
self .assertTrue (
140
141
"Failed to process the request(s) for model instance "
141
142
"'execute_return_error_0', message: Expected a list in the "
142
- "execute return" in str (e .exception ), "Exception message is not correct." )
143
+ "execute return" in str (e .exception ),
144
+ "Exception message is not correct." )
143
145
144
146
# The second inference request will return a list of None object
145
147
# instead of Python InferenceResponse objects.
@@ -150,7 +152,8 @@ def test_incorrect_execute_return(self):
150
152
"Failed to process the request(s) for model instance "
151
153
"'execute_return_error_0', message: Expected an "
152
154
"'InferenceResponse' object in the execute function return"
153
- " list" in str (e .exception ), "Exception message is not correct." )
155
+ " list" in str (e .exception ),
156
+ "Exception message is not correct." )
154
157
155
158
156
159
if __name__ == '__main__' :
0 commit comments