From 8d16ec73841a0b48c7f685a5073d5afa5f82b82f Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 7 Jan 2024 21:37:30 +0100 Subject: smoketest: T5195: fix BasicInterfaceTest tearDown() timeout penalty Commit ad9bdfc24 ("T5195: add timeout argument to process_named_running()") added a 2*10 seconds penalty for every interface test (dhcp and dhcpv6). This leads to long runs of "make test" after an ISO build. There is no need to wait 10 seconds for a test that checks for a process not running. The timeout is there to give the process some time to startup. (cherry picked from commit 041db49533d57cabfccd319492b85ee0bafdd40c) --- python/vyos/utils/process.py | 2 +- smoketest/scripts/cli/base_interfaces_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/vyos/utils/process.py b/python/vyos/utils/process.py index cd58b4be2..bd0644bc0 100644 --- a/python/vyos/utils/process.py +++ b/python/vyos/utils/process.py @@ -204,7 +204,7 @@ def process_running(pid_file): pid = f.read().strip() return pid_exists(int(pid)) -def process_named_running(name, cmdline: str=None, timeout=0): +def process_named_running(name: str, cmdline: str=None, timeout: int=0): """ Checks if process with given name is running and returns its PID. If Process is not running, return None """ diff --git a/smoketest/scripts/cli/base_interfaces_test.py b/smoketest/scripts/cli/base_interfaces_test.py index fb93c9e09..366d71abd 100644 --- a/smoketest/scripts/cli/base_interfaces_test.py +++ b/smoketest/scripts/cli/base_interfaces_test.py @@ -127,9 +127,9 @@ class BasicInterfaceTest: # by also checking the cmd arguments passed to the daemon if self._interfaces: for tmp in self._interfaces: - self.assertFalse(process_named_running(daemon, tmp, timeout=10)) + self.assertFalse(process_named_running(daemon, tmp)) else: - self.assertFalse(process_named_running(daemon, timeout=10)) + self.assertFalse(process_named_running(daemon)) def test_dhcp_disable_interface(self): if not self._test_dhcp: -- cgit v1.2.3