Unuse resources after every test
Fix bug in put_all(). That method was unused before this commit.
Clean the process list after the processes are stopped,
otherwise the suite eventually fails with a 'process terminated
prematurely' error. Before it was not necessary because it was not
reused (a new suite run was created).
Change-Id: Iee12866045145544076c6c18786e1a54f18fc293
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index c78c9fc..f4b9260 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -256,6 +256,9 @@
continue
self.current_test = test
test.run()
+ self.stop_processes()
+ self.objects_cleanup()
+ self.reserved_resources.put_all()
except Exception:
log.log_exn()
except BaseException as e:
@@ -303,10 +306,8 @@
self._processes.insert(0, process)
def stop_processes(self):
- if not self._processes:
- return
- for process in self._processes:
- process.terminate()
+ while self._processes:
+ self._processes.pop().terminate()
def free_resources(self):
if self.reserved_resources is None: