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

[tests] [asan] add graceful stop flag #2347

Merged
merged 1 commit into from
Jun 28, 2022
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
[tests] [asan] add graceful stop flag
Currently, when running the tests with ASAN-enabled image, leak reports
are not generated. The reason is that dvs.destroy() (via 'ctn.remove(force=True)')
uses SIGKILL to stop the container. To address this, a new flag is
added.

When the new flag is set, the swss processes are gracefully stopped (via
SIGTERM).

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
Yakiv-Huryk committed Jun 20, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 81eee6bfe0c3effcd70733dc9f0d6df98ab5fb09
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -89,6 +89,11 @@ def pytest_addoption(parser):
default="traditional",
help="Buffer model")

parser.addoption("--graceful-stop",
action="store_true",
default=False,
help="Stop swss before stopping a conatainer")


def random_string(size=4, chars=string.ascii_uppercase + string.digits):
return "".join(random.choice(chars) for x in range(size))
@@ -1730,6 +1735,8 @@ def manage_dvs(request) -> str:
max_cpu = request.config.getoption("--max_cpu")
buffer_model = request.config.getoption("--buffer_model")
force_recreate = request.config.getoption("--force-recreate-dvs")
graceful_stop = request.config.getoption("--graceful-stop")

dvs = None
curr_dvs_env = [] # lgtm[py/unused-local-variable]

@@ -1778,6 +1785,8 @@ def update_dvs(log_path, new_dvs_env=[]):

yield update_dvs

if graceful_stop:
dvs.stop_swss()
dvs.get_logs()
dvs.destroy()