mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 01:18:29 -04:00
autotest: ensure RC thread is killed after each run_test
Every run_test starts a thread. del is not being called. So clean it up in the caller
This commit is contained in:
parent
500679ec5b
commit
d2c00f7b26
@ -704,6 +704,15 @@ def run_tests(steps):
|
|||||||
results.add(step,
|
results.add(step,
|
||||||
'<span class="failed-text">FAILED</span>',
|
'<span class="failed-text">FAILED</span>',
|
||||||
time.time() - t1)
|
time.time() - t1)
|
||||||
|
|
||||||
|
global tester
|
||||||
|
if tester is not None and tester.rc_thread is not None:
|
||||||
|
if passed:
|
||||||
|
print("BAD: RC Thread still alive after run_step")
|
||||||
|
tester.rc_thread_should_quit = True
|
||||||
|
tester.rc_thread.join()
|
||||||
|
tester.rc_thread = None
|
||||||
|
|
||||||
if not passed:
|
if not passed:
|
||||||
keys = failed_testinstances.keys()
|
keys = failed_testinstances.keys()
|
||||||
if len(keys):
|
if len(keys):
|
||||||
@ -717,14 +726,6 @@ def run_tests(steps):
|
|||||||
|
|
||||||
print("FAILED %u tests: %s" % (len(failed), failed))
|
print("FAILED %u tests: %s" % (len(failed), failed))
|
||||||
|
|
||||||
global tester
|
|
||||||
if tester is not None and tester.rc_thread is not None:
|
|
||||||
if passed:
|
|
||||||
print("BAD: RC Thread still alive after tests passed")
|
|
||||||
tester.rc_thread_should_quit = True
|
|
||||||
tester.rc_thread.join()
|
|
||||||
tester.rc_thread = None
|
|
||||||
|
|
||||||
util.pexpect_close_all()
|
util.pexpect_close_all()
|
||||||
|
|
||||||
write_fullresults()
|
write_fullresults()
|
||||||
|
@ -1274,7 +1274,7 @@ class AutoTest(ABC):
|
|||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if self.rc_thread is not None:
|
if self.rc_thread is not None:
|
||||||
self.progress("Joining thread in __del__")
|
self.progress("Joining RC thread in __del__")
|
||||||
self.rc_thread_should_quit = True
|
self.rc_thread_should_quit = True
|
||||||
self.rc_thread.join()
|
self.rc_thread.join()
|
||||||
self.rc_thread = None
|
self.rc_thread = None
|
||||||
@ -3474,6 +3474,7 @@ class AutoTest(ABC):
|
|||||||
continue
|
continue
|
||||||
bad_channels = ""
|
bad_channels = ""
|
||||||
for chan in map_copy:
|
for chan in map_copy:
|
||||||
|
self.progress("RC values good")
|
||||||
chan_pwm = getattr(m, "chan" + str(chan) + "_raw")
|
chan_pwm = getattr(m, "chan" + str(chan) + "_raw")
|
||||||
if chan_pwm != map_copy[chan]:
|
if chan_pwm != map_copy[chan]:
|
||||||
bad_channels += " (ch=%u want=%u got=%u)" % (chan, map_copy[chan], chan_pwm)
|
bad_channels += " (ch=%u want=%u got=%u)" % (chan, map_copy[chan], chan_pwm)
|
||||||
@ -8616,7 +8617,7 @@ switch value'''
|
|||||||
self.check_logs("FRAMEWORK")
|
self.check_logs("FRAMEWORK")
|
||||||
|
|
||||||
if self.rc_thread is not None:
|
if self.rc_thread is not None:
|
||||||
self.progress("Joining thread")
|
self.progress("Joining RC thread")
|
||||||
self.rc_thread_should_quit = True
|
self.rc_thread_should_quit = True
|
||||||
self.rc_thread.join()
|
self.rc_thread.join()
|
||||||
self.rc_thread = None
|
self.rc_thread = None
|
||||||
|
Loading…
Reference in New Issue
Block a user