Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_cpu_memory_usage.py update memory threshold for 4600 and 2700 #15948

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/platform_tests/test_cpu_memory_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
Loading