Skip to content

Refine critical process monitor wait time logic #8116

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

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tests/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
RESOLV_CONF_NAMESERVERS = {
"public": []
}
KVM_PLATFORM = 'x86_64-kvm_x86_64-r0'
12 changes: 9 additions & 3 deletions tests/process_monitoring/test_critical_process_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from pkg_resources import parse_version
from tests.common import config_reload
from tests.common.constants import KVM_PLATFORM
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.assertions import pytest_require
from tests.common.helpers.constants import DEFAULT_ASIC_ID, NAMESPACE_PREFIX
Expand Down Expand Up @@ -586,9 +587,14 @@ def test_monitoring_critical_processes(duthosts, rand_one_dut_hostname, tbinfo,

stop_critical_processes(duthost, containers_in_namespaces)

# Wait for 90 seconds such that Supervisord/Monit has a chance to write alerting message into syslog.
logger.info("Sleep 90 seconds to wait for the alerting messages in syslog...")
time.sleep(90)
wait_time = 70
# For KVM DUT, there's a delay(~25s) that syncd process raises SIGKILL signal after been killed
if duthost.facts['platform'] == KVM_PLATFORM:
wait_time = 90

# Wait for sometime such that Supervisord/Monit has a chance to write alerting message into syslog.
logger.info("Sleep {} seconds to wait for the alerting messages in syslog...".format(wait_time))
time.sleep(wait_time)

logger.info("Checking the alerting messages from syslog...")
loganalyzer.analyze(marker)
Expand Down