diff --git a/qa/L0_model_update/instance_update_test.py b/qa/L0_model_update/instance_update_test.py index 5fa0eb3071..421292310f 100644 --- a/qa/L0_model_update/instance_update_test.py +++ b/qa/L0_model_update/instance_update_test.py @@ -338,10 +338,10 @@ def test_infer_while_updating(self): # Unload model self.__unload_model() - # Test instance resource requirement increase + # Test instance resource requirement update @unittest.skipUnless(os.environ["RATE_LIMIT_MODE"] == "execution_count", "Rate limiter precondition not met for this test") - def test_instance_resource_increase(self): + def test_instance_resource_update(self): # Load model self.__load_model( 1, @@ -365,6 +365,20 @@ def infer(): time.sleep(infer_count / 2) # each infer should take < 0.5 seconds self.assertNotIn(False, infer_complete, "Infer possibly stuck") infer_thread.result() + # Decrease the resource requirement + self.__update_instance_count( + 1, 1, + "{\ncount: 1\nkind: KIND_CPU\nrate_limiter {\nresources [\n{\nname: \"R1\"\ncount: 6\n}\n]\n}\n}" + ) + # Further decrease the resource requirement. The previous decrease + # should have lower the max resource in the rate limiter, which the + # error "Should not print this ..." should not be printed into the + # server log because the max resource is above the previously set limit + # and it will be checked by the main bash test script. + self.__update_instance_count( + 1, 1, + "{\ncount: 1\nkind: KIND_CPU\nrate_limiter {\nresources [\n{\nname: \"R1\"\ncount: 4\n}\n]\n}\n}" + ) # Unload model self.__unload_model() diff --git a/qa/L0_model_update/test.sh b/qa/L0_model_update/test.sh index 9246ef7ae1..5a4eb09d69 100755 --- a/qa/L0_model_update/test.sh +++ b/qa/L0_model_update/test.sh @@ -83,6 +83,15 @@ for RATE_LIMIT_MODE in "off" "execution_count"; do kill $SERVER_PID wait $SERVER_PID + set +e + grep "Should not print this" $SERVER_LOG + if [ $? -eq 0 ]; then + echo -e "\n***\n*** Found \"Should not print this\" on \"$SERVER_LOG\"\n***" + cat $SERVER_LOG + RET=1 + fi + set -e + done if [ $RET -eq 0 ]; then