提交 c104f81a 编写于 作者: L Lukáš Doktor

selftests: Kill the process before waiting

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: NLukáš Doktor <ldoktor@redhat.com>
上级 5bc53a15
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册