-
Notifications
You must be signed in to change notification settings - Fork 718
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
implement memory utilization fixture #13698
implement memory utilization fixture #13698
Conversation
Signed-off-by: xuliping <xuliping@microsoft.com>
tests/common/plugins/memory_utilization/memory_utilization_common.json
Outdated
Show resolved
Hide resolved
/azp run |
Commenter does not have sufficient privileges for PR 13698 in repo sonic-net/sonic-mgmt |
@lipxu could we have an example to give when this check passed / failed? |
Sure, added the examples for supported memory items. |
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
/azp run Azure.sonic-mgmt |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-mgmt |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-mgmt |
Commenter does not have sufficient privileges for PR 13698 in repo sonic-net/sonic-mgmt |
hi @lipxu should we consider when this fixture can kick in? if it is after teardown, it may not work as expected since all process could be already reloaded without memory leak evidence. |
I've updated the branch by adding the following two functions and adjusted the setup to use "trylast" and teardown to use "tryfirst". This will allow memory utilization to collect the memory information before and after the test case. ensuring accurate capture memory usage of the test case. @pytest.hookimpl(trylast=True) @pytest.hookimpl(tryfirst=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hi @lipxu LGTM, could you work with other reviewers to close the comment before we get this merged? |
What is the motivation for this PR? There was a production issue related to the memory leak caused by link flap. How did you do it? Add a new stress link flap cases. with the memory utilization fixture #13698. Could check the memory information before and after the stress link flap case and failure if any memory leak. Currently, the test time is 10 minutes for nightly run. would add a parameter to enlarge the test times and run the case much longer for stress flaps. How did you verify/test it? Run the case locally. bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[dut] PASSED [ 25%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[fanout] PASSED [ 50%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[neighbor] PASSED [ 75%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[all] PASSED [100%] Verify the case on kvm https://elastictest.org/scheduler/testplan/66b9d5c20fde6eb55e3adcf https://elastictest.org/scheduler/testplan/66b9d5b8a79f777a863fe6f8
What is the motivation for this PR? There was a production issue related to the memory leak caused by link flap. How did you do it? Add a new stress link flap cases. with the memory utilization fixture sonic-net#13698. Could check the memory information before and after the stress link flap case and failure if any memory leak. Currently, the test time is 10 minutes for nightly run. would add a parameter to enlarge the test times and run the case much longer for stress flaps. How did you verify/test it? Run the case locally. bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[dut] PASSED [ 25%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[fanout] PASSED [ 50%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[neighbor] PASSED [ 75%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[all] PASSED [100%] Verify the case on kvm https://elastictest.org/scheduler/testplan/66b9d5c20fde6eb55e3adcf https://elastictest.org/scheduler/testplan/66b9d5b8a79f777a863fe6f8
What is the motivation for this PR? There was a production issue related to the memory leak caused by link flap. How did you do it? Add a new stress link flap cases. with the memory utilization fixture #13698. Could check the memory information before and after the stress link flap case and failure if any memory leak. Currently, the test time is 10 minutes for nightly run. would add a parameter to enlarge the test times and run the case much longer for stress flaps. How did you verify/test it? Run the case locally. bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[dut] PASSED [ 25%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[fanout] PASSED [ 50%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[neighbor] PASSED [ 75%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[all] PASSED [100%] Verify the case on kvm https://elastictest.org/scheduler/testplan/66b9d5c20fde6eb55e3adcf https://elastictest.org/scheduler/testplan/66b9d5b8a79f777a863fe6f8
What is the motivation for this PR? Test gap for memory leak How did you do it? Introduced a new fixture to collect the memory information before and after the test case. Then compare the memory information to confirm that it has not exceeded the high memory usage threshold and that no memory leaks have occurred. How did you verify/test it? Run case locally. Set a fake threshold, check the result. Run nightly pipeline.
What is the motivation for this PR? There was a production issue related to the memory leak caused by link flap. How did you do it? Add a new stress link flap cases. with the memory utilization fixture sonic-net#13698. Could check the memory information before and after the stress link flap case and failure if any memory leak. Currently, the test time is 10 minutes for nightly run. would add a parameter to enlarge the test times and run the case much longer for stress flaps. How did you verify/test it? Run the case locally. bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[dut] PASSED [ 25%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[fanout] PASSED [ 50%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[neighbor] PASSED [ 75%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[all] PASSED [100%] Verify the case on kvm https://elastictest.org/scheduler/testplan/66b9d5c20fde6eb55e3adcf https://elastictest.org/scheduler/testplan/66b9d5b8a79f777a863fe6f8
What is the motivation for this PR? Test gap for memory leak How did you do it? Introduced a new fixture to collect the memory information before and after the test case. Then compare the memory information to confirm that it has not exceeded the high memory usage threshold and that no memory leaks have occurred. How did you verify/test it? Run case locally. Set a fake threshold, check the result. Run nightly pipeline.
What is the motivation for this PR? There was a production issue related to the memory leak caused by link flap. How did you do it? Add a new stress link flap cases. with the memory utilization fixture sonic-net#13698. Could check the memory information before and after the stress link flap case and failure if any memory leak. Currently, the test time is 10 minutes for nightly run. would add a parameter to enlarge the test times and run the case much longer for stress flaps. How did you verify/test it? Run the case locally. bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[dut] PASSED [ 25%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[fanout] PASSED [ 50%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[neighbor] PASSED [ 75%] bgp/test_bgp_stress_link_flap.py::test_bgp_stress_link_flap[all] PASSED [100%] Verify the case on kvm https://elastictest.org/scheduler/testplan/66b9d5c20fde6eb55e3adcf https://elastictest.org/scheduler/testplan/66b9d5b8a79f777a863fe6f8
Description of PR
Summary:
Fixes # (issue)
27216861
Type of change
Back port request
Approach
What is the motivation for this PR?
Test gap for memory leak
How did you do it?
Introduced a new fixture to collect the memory information before and after the test case.
Then compare the memory information to confirm that it has not exceeded the high memory usage threshold and that no memory leaks have occurred.
How did you verify/test it?
Run case locally.
Set a fake threshold, check the result.
Run nightly pipeline.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation