From f6ead9329160068c328b59782df4be19f559ef2c Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:12:05 +0800 Subject: [PATCH] update threshold (#15948) --- tests/platform_tests/test_cpu_memory_usage.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/platform_tests/test_cpu_memory_usage.py b/tests/platform_tests/test_cpu_memory_usage.py index 7c63cf56fca..426807bf9e7 100644 --- a/tests/platform_tests/test_cpu_memory_usage.py +++ b/tests/platform_tests/test_cpu_memory_usage.py @@ -38,8 +38,10 @@ def setup_thresholds(duthosts, enum_rand_one_per_hwsku_hostname): if duthost.facts['platform'] in ('x86_64-arista_7050_qx32', 'x86_64-kvm_x86_64-r0', 'x86_64-arista_7050_qx32s', 'x86_64-cel_e1031-r0', 'x86_64-arista_7800r3a_36dm2_lc') or is_asan: memory_threshold = 90 - if duthost.facts['platform'] in ('x86_64-mlnx_msn4600c-r0', 'x86_64-mlnx_msn3800-r0', 'x86_64-8800_rp_o-r0', - 'x86_64-8800_rp-r0'): + if duthost.facts['platform'] in ('x86_64-mlnx_msn4600c-r0', 'x86_64-mlnx_msn3800-r0', + 'x86_64-mlnx_msn2700-r0', 'x86_64-mlnx_msn2700a1-r0'): + memory_threshold = 70 + if duthost.facts['platform'] in ('x86_64-8800_rp_o-r0', 'x86_64-8800_rp-r0'): memory_threshold = 65 if duthost.facts['platform'] in ('x86_64-arista_7260cx3_64'): high_cpu_consume_procs['syncd'] = 80 @@ -256,9 +258,14 @@ def update_cpu_usage_desired_program(proc, program_to_check, program_to_check_cp def check_memory(i, memory_threshold, monit_result, outstanding_mem_polls): used_memory_percent = monit_result.memory['used_percent'] + logging.debug( + "System memory usage: %d%% (%s %d%%) - Result: %s", + used_memory_percent, + "exceed" if used_memory_percent > memory_threshold else "below", + memory_threshold, + monit_result.memory + ) if used_memory_percent > memory_threshold: - logging.debug("system memory usage %d%% exceeds %d%%: %s", - used_memory_percent, memory_threshold, monit_result.memory) outstanding_mem_polls[i] = monit_result.memory