Skip to content

Commit bd7d850

Browse files
authored
Refine critical process monitor wait time logic (#8116)
Approach What is the motivation for this PR? Refine the wait time of test_critical_process_monitoring.py, wait for 90s on KVM duts but only waiting for 70s on physical duts to avoid the syncd delay issue being missed. co-authorized by: [email protected]
1 parent ce35631 commit bd7d850

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/common/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
RESOLV_CONF_NAMESERVERS = {
1717
"public": []
1818
}
19+
KVM_PLATFORM = 'x86_64-kvm_x86_64-r0'

tests/process_monitoring/test_critical_process_monitoring.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from pkg_resources import parse_version
1212
from tests.common import config_reload
13+
from tests.common.constants import KVM_PLATFORM
1314
from tests.common.helpers.assertions import pytest_assert
1415
from tests.common.helpers.assertions import pytest_require
1516
from tests.common.helpers.constants import DEFAULT_ASIC_ID, NAMESPACE_PREFIX
@@ -586,9 +587,14 @@ def test_monitoring_critical_processes(duthosts, rand_one_dut_hostname, tbinfo,
586587

587588
stop_critical_processes(duthost, containers_in_namespaces)
588589

589-
# Wait for 90 seconds such that Supervisord/Monit has a chance to write alerting message into syslog.
590-
logger.info("Sleep 90 seconds to wait for the alerting messages in syslog...")
591-
time.sleep(90)
590+
wait_time = 70
591+
# For KVM DUT, there's a delay(~25s) that syncd process raises SIGKILL signal after been killed
592+
if duthost.facts['platform'] == KVM_PLATFORM:
593+
wait_time = 90
594+
595+
# Wait for sometime such that Supervisord/Monit has a chance to write alerting message into syslog.
596+
logger.info("Sleep {} seconds to wait for the alerting messages in syslog...".format(wait_time))
597+
time.sleep(wait_time)
592598

593599
logger.info("Checking the alerting messages from syslog...")
594600
loganalyzer.analyze(marker)

0 commit comments

Comments
 (0)