From bb973ac913f77531ecb06d2be03ab7b53e127a0e Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 6 Nov 2021 12:49:46 +1100 Subject: [PATCH] autotest: print content of sitl /proc/PID/status on death Mysterious death ofi Copter in CI - add more debug --- Tools/autotest/common.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 5ad953a53d..56930f9d38 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -6057,6 +6057,11 @@ Also, ignores heartbeats not from our target system''' pass self.progress("Most recent logfile: %s" % (path, ), send_statustext=send_statustext) + def progress_file_content(self, filepath): + with open(filepath) as f: + for line in f: + self.progress(line.rstrip()) + def run_one_test_attempt(self, test, interact=False, attempt=1, do_fail_list=True): '''called by run_one_test to actually run the test in a retry loop''' name = test.name @@ -6112,7 +6117,7 @@ Also, ignores heartbeats not from our target system''' ardupilot_alive = True except Exception: # process is dead - self.progress("Not alive after test", send_statustext=False) + self.progress("No heartbeat after test", send_statustext=False) if self.sitl.isalive(): self.progress("pexpect says it is alive") for tool in "dumpstack.sh", "dumpcore.sh": @@ -6122,6 +6127,15 @@ Also, ignores heartbeats not from our target system''' return False else: self.progress("pexpect says it is dead") + + # try dumping the process status file for more information: + status_filepath = "/proc/%u/status" % self.sitl.pid + self.progress("Checking for status filepath (%s)" % status_filepath) + if os.path.exists(status_filepath): + self.progress_file_content(status_filepath) + else: + self.progress("... does not exist") + passed = False reset_needed = True