autotest: bisect-helper.py: improve py2 compatability, improve diagnostics

This commit is contained in:
Peter Barker 2023-05-03 20:59:45 +10:00 committed by Peter Barker
parent 237bcf7b7a
commit 40a3e076fc
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,10 @@
'''A helper script for bisecting common problems when working with ArduPilot
When running bisections, you should
export SITL_PANIC_EXIT=1
Bisect between a commit which builds and one which doesn't,
finding the first commit which broke the build with a
specific failure:
@ -276,7 +280,7 @@ class BisectCITest(Bisect):
if code == self.exit_fail_code():
with open("/tmp/fail-counts", "a") as f:
print("Failed on run %u" % (i+1,), file=f)
f.write("Failed on run %u\n" % (i+1,))
if ignore:
self.progress("Ignoring this run")
continue
@ -285,6 +289,8 @@ class BisectCITest(Bisect):
self.git_reset()
self.progress("Exit code is %u" % code)
sys.exit(code)