From fbab6230702dd353bce71fe7e3116f4b5b97a600 Mon Sep 17 00:00:00 2001 From: xuliping Date: Sun, 8 Dec 2024 16:35:23 +0000 Subject: [PATCH] update threshold --- tests/platform_tests/test_cpu_memory_usage.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/platform_tests/test_cpu_memory_usage.py b/tests/platform_tests/test_cpu_memory_usage.py index 9948d23f2f4..df13e7ddba5 100644 --- a/tests/platform_tests/test_cpu_memory_usage.py +++ b/tests/platform_tests/test_cpu_memory_usage.py @@ -38,8 +38,9 @@ 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'): - memory_threshold = 65 + 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-arista_7260cx3_64'): high_cpu_consume_procs['syncd'] = 80 # The CPU usage of `sx_sdk` on mellanox is expected to be higher, and the actual CPU usage @@ -255,9 +256,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