mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Test runner: Terminate all px4 apps correctly
Without this change an aborted run leaves zombie processes running.
This commit is contained in:
@@ -8,6 +8,7 @@ import os
|
|||||||
import psutil
|
import psutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import signal
|
||||||
|
|
||||||
|
|
||||||
test_matrix = [
|
test_matrix = [
|
||||||
@@ -79,6 +80,13 @@ class Runner:
|
|||||||
if returncode is not None:
|
if returncode is not None:
|
||||||
return returncode
|
return returncode
|
||||||
|
|
||||||
|
print("Sending SIGINT to {}".format(self.process.pid))
|
||||||
|
self.process.send_signal(signal.SIGINT)
|
||||||
|
try:
|
||||||
|
return self.process.wait(timeout=1)
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
pass
|
||||||
|
|
||||||
print("Terminating {}".format(self.process.pid))
|
print("Terminating {}".format(self.process.pid))
|
||||||
self.process.terminate()
|
self.process.terminate()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user