summaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/process.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-04-04 16:43:12 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-04-04 17:48:30 +0200
commit0409655e64e43a022950748cca2494b9846af97a (patch)
tree6a97df08e39bfe2959a349974510d9dc6cb082b7 /src/osmo_gsm_tester/process.py
parent806aae88306a3c724a162c39a930b40361724f42 (diff)
process: Early return during process termination if no proc running
This avoids extra unneeded logging about killing with signal when actually no signal is being sent. Change-Id: I5b5dd78fe3301d8eef2ab93da3b37029268ae198
Diffstat (limited to 'src/osmo_gsm_tester/process.py')
-rw-r--r--src/osmo_gsm_tester/process.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 441d4ea..66ecae5 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -104,7 +104,10 @@ class ParallelTerminationStrategy(TerminationStrategy):
time.sleep(wait_step)
def terminate_all(self):
- self.dbg("Scheduled to terminate %d processes." % len(self._processes))
+ num_processes = len(self._processes)
+ self.dbg("Scheduled to terminate %d processes." % num_processes)
+ if num_processes == 0:
+ return
self._prune_dead_processes(True)
self._build_process_map()
@@ -116,6 +119,8 @@ class ParallelTerminationStrategy(TerminationStrategy):
if sig == signal.SIGKILL:
continue
self._poll_for_termination()
+ if len(self._processes) == 0:
+ return
class Process(log.Origin):