mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +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 subprocess
|
||||
import sys
|
||||
import signal
|
||||
|
||||
|
||||
test_matrix = [
|
||||
@@ -79,6 +80,13 @@ class Runner:
|
||||
if returncode is not None:
|
||||
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))
|
||||
self.process.terminate()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user