mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-19 05:40:37 +08:00
test: Strengthen the timeout handling by killing the process.
This commit is contained in:
@@ -63,6 +63,7 @@ class file(config.file):
|
|||||||
self.output = None
|
self.output = None
|
||||||
self.report = report
|
self.report = report
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.timedout = False
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.console:
|
if self.console:
|
||||||
@@ -76,6 +77,9 @@ class file(config.file):
|
|||||||
self.lock.release()
|
self.lock.release()
|
||||||
|
|
||||||
def _timeout(self):
|
def _timeout(self):
|
||||||
|
self._lock()
|
||||||
|
self.timedout = True
|
||||||
|
self._unlock()
|
||||||
self.capture('*** TIMEOUT TIMEOUT')
|
self.capture('*** TIMEOUT TIMEOUT')
|
||||||
|
|
||||||
def _dir_console(self, data):
|
def _dir_console(self, data):
|
||||||
@@ -109,10 +113,12 @@ class file(config.file):
|
|||||||
ec, proc = self.process.open(data,
|
ec, proc = self.process.open(data,
|
||||||
timeout = (int(self.expand('%{timeout}')),
|
timeout = (int(self.expand('%{timeout}')),
|
||||||
self._timeout))
|
self._timeout))
|
||||||
|
self._lock()
|
||||||
if ec > 0:
|
if ec > 0:
|
||||||
self._lock()
|
|
||||||
self._error('execute failed: %s: exit-code:%d' % (' '.join(data), ec))
|
self._error('execute failed: %s: exit-code:%d' % (' '.join(data), ec))
|
||||||
self._unlock()
|
elif self.timedout:
|
||||||
|
self.process.kill()
|
||||||
|
self._unlock()
|
||||||
if self.console:
|
if self.console:
|
||||||
self.console.close()
|
self.console.close()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user