File tree 2 files changed +25
-2
lines changed
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -338,10 +338,10 @@ def test_infer_while_updating(self):
338
338
# Unload model
339
339
self .__unload_model ()
340
340
341
- # Test instance resource requirement increase
341
+ # Test instance resource requirement update
342
342
@unittest .skipUnless (os .environ ["RATE_LIMIT_MODE" ] == "execution_count" ,
343
343
"Rate limiter precondition not met for this test" )
344
- def test_instance_resource_increase (self ):
344
+ def test_instance_resource_update (self ):
345
345
# Load model
346
346
self .__load_model (
347
347
1 ,
@@ -365,6 +365,20 @@ def infer():
365
365
time .sleep (infer_count / 2 ) # each infer should take < 0.5 seconds
366
366
self .assertNotIn (False , infer_complete , "Infer possibly stuck" )
367
367
infer_thread .result ()
368
+ # Decrease the resource requirement
369
+ self .__update_instance_count (
370
+ 1 , 1 ,
371
+ "{\n count: 1\n kind: KIND_CPU\n rate_limiter {\n resources [\n {\n name: \" R1\" \n count: 6\n }\n ]\n }\n }"
372
+ )
373
+ # Further decrease the resource requirement. The previous decrease
374
+ # should have lower the max resource in the rate limiter, which the
375
+ # error "Should not print this ..." should not be printed into the
376
+ # server log because the max resource is above the previously set limit
377
+ # and it will be checked by the main bash test script.
378
+ self .__update_instance_count (
379
+ 1 , 1 ,
380
+ "{\n count: 1\n kind: KIND_CPU\n rate_limiter {\n resources [\n {\n name: \" R1\" \n count: 4\n }\n ]\n }\n }"
381
+ )
368
382
# Unload model
369
383
self .__unload_model ()
370
384
Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ for RATE_LIMIT_MODE in "off" "execution_count"; do
83
83
kill $SERVER_PID
84
84
wait $SERVER_PID
85
85
86
+ set +e
87
+ grep " Should not print this" $SERVER_LOG
88
+ if [ $? -eq 0 ]; then
89
+ echo -e " \n***\n*** Found \" Should not print this\" on \" $SERVER_LOG \" \n***"
90
+ cat $SERVER_LOG
91
+ RET=1
92
+ fi
93
+ set -e
94
+
86
95
done
87
96
88
97
if [ $RET -eq 0 ]; then
You can’t perform that action at this time.
0 commit comments