From d688a143c3c4a7e4e4539aa175669c26a0ac89d3 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Tue, 14 Jul 2015 01:48:09 +0100 Subject: Fix stability issues at the end of testcase run. Cleanup procedure is performed at the end of each testcase run. Procedure consists of termination of vswitch processes, removal of unneeded kernel drivers, unmount of hugepages, etc. There must be enough time for vswitch processes to terminate properly before OS resources are freed. Otherwise OS stability issues can be observed (e.g. server reboot). Process termination is implemented by sending signal SIGTERM to the process instead of previously used signal SIGINT. Change-Id: I7e8c7a86ae2a75f2a18db0d9340726fb649a685b JIRA: VSPERF-27 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Billy O Mahony Reviewed-by: Eugene Snider Reviewed-by: Gurpreet Singh Reviewed-by: Tv Rao --- tools/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/tasks.py b/tools/tasks.py index f8f11d4e..555a5929 100644 --- a/tools/tasks.py +++ b/tools/tasks.py @@ -23,6 +23,7 @@ import threading import sys import os import locale +import time from conf import settings @@ -244,8 +245,10 @@ class Process(object): """Kill process instance if it is alive. """ if self._child and self._child.isalive(): - run_task(['sudo', 'kill', '-2', str(self._child.pid)], + run_task(['sudo', 'kill', '-15', str(self._child.pid)], self._logger) + self._logger.debug('Wait for process to terminate') + time.sleep(2) if self.is_relinquished(): self._relinquish_thread.join() -- cgit 1.2.3-korg