summaryrefslogtreecommitdiff
path: root/tester
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-06-01 14:43:03 +1000
committerChris Johns <chrisj@rtems.org>2014-06-01 14:43:03 +1000
commit60937e1775d38b1133a1d2ac7336b069a3cbb5b8 (patch)
tree10c6e0b4d341b2799119e6823c4a1dedc18c81b7 /tester
parentc04a84917a82caa06b8efc4f24d3b60ed8f05d78 (diff)
test: Strengthen the timeout handling by killing the process.
Diffstat (limited to 'tester')
-rw-r--r--tester/rt/config.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tester/rt/config.py b/tester/rt/config.py
index d431093..ac9c8aa 100644
--- a/tester/rt/config.py
+++ b/tester/rt/config.py
@@ -63,6 +63,7 @@ class file(config.file):
self.output = None
self.report = report
self.name = name
+ self.timedout = False
def __del__(self):
if self.console:
@@ -76,6 +77,9 @@ class file(config.file):
self.lock.release()
def _timeout(self):
+ self._lock()
+ self.timedout = True
+ self._unlock()
self.capture('*** TIMEOUT TIMEOUT')
def _dir_console(self, data):
@@ -109,10 +113,12 @@ class file(config.file):
ec, proc = self.process.open(data,
timeout = (int(self.expand('%{timeout}')),
self._timeout))
+ self._lock()
if ec > 0:
- self._lock()
self._error('execute failed: %s: exit-code:%d' % (' '.join(data), ec))
- self._unlock()
+ elif self.timedout:
+ self.process.kill()
+ self._unlock()
if self.console:
self.console.close()