From c104f81a5b311cc2b8b2320107394305cf20acdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Thu, 14 Feb 2019 08:41:25 +0100 Subject: [PATCH] selftests: Kill the process before waiting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fake-vmstat process should run for infinity. Using wait with 1s timeout will eventually destroy the test after the timeout, but cleaner solution is to explicitly terminate it and then use the wait to make sure it finished (or eventually nuke it) Signed-off-by: Lukáš Doktor --- selftests/functional/test_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selftests/functional/test_utils.py b/selftests/functional/test_utils.py index 746fa620..bc3a1935 100644 --- a/selftests/functional/test_utils.py +++ b/selftests/functional/test_utils.py @@ -142,6 +142,7 @@ class ProcessTest(unittest.TestCase): proc = process.SubProcess('%s 1' % self.fake_vmstat) proc.start() time.sleep(3) + proc.terminate() proc.wait(timeout=1) stdout = proc.get_stdout().decode() self.assertIn('memory', stdout, 'result: %s' % stdout) -- GitLab