[snmp_memory] add SNMP memory test#373
Conversation
Signed-off-by: okanchou9 <[email protected]>
|
|
||
| - name: Validating SNMP total free memory matches shell result before stress test | ||
| assert: | ||
| that: "{{ '%.6f'|format((ansible_sysTotalFreeMemery|int - shell_total_free_memory.stdout|int)|abs / ansible_sysTotalFreeMemery|int) }} <= 0.03" |
There was a problem hiding this comment.
is 3% tolerance too small? can we allow like 10% tolerance to make the test more robust.
There was a problem hiding this comment.
Since I have 8G RAM in my box, the 3% tolerance of 8G is about 246M already.
I'm not sure the quality of this test if we allow 10% tolerance in this test.
Any good idea?
There was a problem hiding this comment.
make this as an test parameter, let's the default to 5%?
| - name: Stop memory stress generation | ||
| shell: killall python /tmp/memory.py | ||
| become: yes | ||
| ignore_errors: true |
There was a problem hiding this comment.
if previous assert fails, your code will not kill the process and the box will have high memory consumption.
There was a problem hiding this comment.
Don't worry about it, I wrote the "always" section which will kill again this python process at line 99 if previous assert failed.
There was a problem hiding this comment.
actually, my question is that if the above assert, will ansible stop there? If ansible stops, then you will not be able to execute subsequent commands.
check here. http://docs.ansible.com/ansible/latest/playbooks_error_handling.html
"Generally playbooks will stop executing any more steps on a host that has a task fail."
There was a problem hiding this comment.
I see what you mean. I think it is ok.
|
|
||
| - name: Validating memory leak issue on DUT | ||
| assert: | ||
| that: "{{ '%.6f'|format((free_memery_before_test|int - ansible_sysTotalFreeMemery|int)|abs / free_memery_before_test|int) }} <= 0.03" |
There was a problem hiding this comment.
where does this memory leak comes from? the python program?
There was a problem hiding this comment.
Yes, those memories which hold by this python process should be released after terminated it.
If the difference between the size of free memory before and after this stress test is more than 3%, I can only consider there is a memory leak happened when terminated the python process.
There was a problem hiding this comment.
it is hard to say, the other process might increase the usage of memory.
There was a problem hiding this comment.
checking memory leak is a hard problem, I am mainly worry about the false positive.
There was a problem hiding this comment.
hmmm, just removed this test case from this PR and I'll find better way to test the memory leak. Thanks for your info.
|
|
||
| - set_fact: free_memery_before_test="{{ ansible_sysTotalFreeMemery }}" | ||
|
|
||
| - set_fact: test_momory="{{ ((ansible_sysTotalFreeMemery - 512000) / 1024)|int }}" |
There was a problem hiding this comment.
why minus 512M memory? what is the purpose of memory stress test? is it just to verify the snmp can pick the memory consumption changes or there is some other goal? if only the first goal, then we just need to fill a few hundreds MB and check. We do not need to fill all the available memory.
There was a problem hiding this comment.
This test will also check the SNMP process is still functional or not in suck low free memory condition.
It's enough for my box that only left 512M for system free memory.
Please let me know if any.
There was a problem hiding this comment.
my request here is that can we skip this, if the sysTotalFreeMemory is already less then 512000? As above, can we make this as a tunable parameter, you can make 512M as the default value.
Signed-off-by: okanchou9 <[email protected]>
|
can you add instruction to here. https://github.com/Azure/sonic-mgmt/blob/master/ansible/README.test.md |
Signed-off-by: okanchou9 <[email protected]>
Signed-off-by: Guohan Lu <[email protected]>
…D automatically (sonic-net#15749) src/sonic-platform-daemons * 112656c - (HEAD -> 202205, origin/202205) [ycabled][active-active] no initialize Async Client, when no active-active cable type; fix names for all ycabled threads (sonic-net#373) (4 minutes ago) [vdahiya12] * e325d5a - Revert "Revert "[ycabled] correct the wrong function call for 'config hwmode state' (sonic-net#372)"" (4 minutes ago) [Ying Xie] * ddabca1 - Revert "Revert "[dualtor] Fix command `show mux status` (sonic-net#371)"" (4 minutes ago) [Ying Xie] * 28918da - Revert "Revert "[ycabled] fix bug for `show mux status` delayed response (sonic-net#364)"" (4 minutes ago) [Ying Xie] * a849de9 - Revert "Revert "add async notification support in active-active topo; refactor code for ycable tasks for change events (sonic-net#327)"" (4 minutes ago) [Ying Xie] * cf1e73a - Revert "Revert "[ycabled] refactor code for onboarding async client changes;refactor (sonic-net#355)"" (4 minutes ago) [Ying Xie]
Signed-off-by: okanchou9 [email protected]
How I did it
Please refer the diff for the details.
How to verify it
Run test with on my box and passed without any issue. Log