diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index f4e140f98d..36e7bd3967 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -3017,26 +3017,6 @@ class TestSuite(ABC): util.pexpect_close(self.sitl) self.sitl = None - def close(self): - """Tidy up after running all tests.""" - - if self.mav is not None: - self.mav.close() - self.mav = None - self.stop_SITL() - - valgrind_log = util.valgrind_log_filepath(binary=self.binary, - model=self.frame) - files = glob.glob("*" + valgrind_log) - for valgrind_log in files: - os.chmod(valgrind_log, 0o644) - if os.path.getsize(valgrind_log) > 0: - target = self.buildlogs_path("%s-%s" % ( - self.log_name(), - os.path.basename(valgrind_log))) - self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target)) - shutil.move(valgrind_log, target) - def start_test(self, description): self.progress("##################################################################################") self.progress("########## %s ##########" % description) @@ -11656,7 +11636,24 @@ switch value''' self.rc_thread_should_quit = True self.rc_thread.join() self.rc_thread = None - self.close() + + if self.mav is not None: + self.mav.close() + self.mav = None + + self.stop_SITL() + + valgrind_log = util.valgrind_log_filepath(binary=self.binary, + model=self.frame) + files = glob.glob("*" + valgrind_log) + for valgrind_log in files: + os.chmod(valgrind_log, 0o644) + if os.path.getsize(valgrind_log) > 0: + target = self.buildlogs_path("%s-%s" % ( + self.log_name(), + os.path.basename(valgrind_log))) + self.progress("Valgrind log: moving %s to %s" % (valgrind_log, target)) + shutil.move(valgrind_log, target) return result_list