summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-08-13 12:56:11 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-08-13 13:07:30 +0000
commit91b9040b68ea7e36704488c6ac545f76172d5443 (patch)
treec5d56bb21b4fbbe9a9413402a7a93a7fbb3ed138
parent5ae5d906ca51888591956ee9cd7578829a4e9cfa (diff)
round-robin-bisect.sh: Handle a row of skipped commits in a bisection
When we get a big chunk of commits causing uninteresting failures (e.g., we are bisecting testsuite regressions, but toolchain fails to build), we can spend days on trying to test all such "skipped" commits. To make progress in the bisection we mark occasional "skipped" commit as "bad". After that we either get lucky and get outside of the commit range that doesn't build, or we get less lucky and mark one of such commits as "first_bad". In this latter case we handle this in the same way as failures from "git bisect run", which it, actually, is. Change-Id: I4094e9f717350ee617d06e26fecf27a149b437dc
-rwxr-xr-xround-robin-bisect.sh37
-rw-r--r--round-robin.sh4
2 files changed, 36 insertions, 5 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 6822e606..071d4adf 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -212,7 +212,33 @@ if [ x"\$res" != x"0" ]; then
if [ -f $rel_artifacts/build-\$rev/trigger-build-$current_project ]; then
exit 1
else
- exit 125
+ # The build failed due to an uninteresting problem -- a prerequisite
+ # failed to build or benchmarking harness went down. We mark such
+ # revisions "skipped", but up to a point. If we skip more revisions
+ # in a row, than half the number of tests necessary to finish the bisect,
+ # then we mark such "skipped" revision as "bad".
+
+ # Number of "git bisect skip" in a row
+ n_skips=\$(git -C $current_project bisect log | awk '
+BEGIN { n_skips=0 }
+/git bisect skip/ { n_skips++; next }
+/git bisect/ { n_skips=0 }
+END { print n_skips }
+')
+ revs_left=\$(git -C $current_project bisect view --pretty=%H | wc -l)
+ # Half the number of steps to finish the bisect
+ n_steps_2=\$(echo "n_steps=l(\$revs_left)/l(2); scale=0; n_steps/2" | bc -l)
+ if [ \$n_steps_2 -lt 2 ]; then
+ # Avoid skipping revisions at the end of the bisect.
+ n_steps_2=2
+ fi
+ if [ \$n_skips -le \$n_steps_2 ]; then
+ exit 125
+ else
+ # We had several skips in a row and still have many revisions to bisect.
+ # Mark this one "bad" to progress the bisect.
+ exit 1
+ fi
fi
else
exit 0
@@ -468,7 +494,8 @@ first_bad=$(get_first_bad)
reset_rev="$first_bad"
notify_devs=true
notify_author=""
-if [ x"$first_bad" != x"" ]; then
+if [ x"$first_bad" != x"" ] \
+ && [ -f $artifacts/build-$first_bad/trigger-build-$current_project ]; then
# "git bisect run" succeeded. Check whether this is an actual regression
# or bisection artifact.
last_good=""
@@ -533,7 +560,8 @@ EOF
exit 0
fi
else
- # "Git bisect" didn't find the first_bad commit.
+ # "Git bisect" didn't find the first_bad commit or this commit points to
+ # an uninteresting regression.
# Possible reasons include:
# - We have marked the regressing commit as "skip", which can happen
# to tcwg_bmk* projects when benchmarking infra has a problem.
@@ -542,6 +570,9 @@ else
# We want to reset baseline to HEAD in this case, so that we catch most
# of the commits that introduced change in the result metric.
#
+ # - We have marked a skipped commit as bad to advance bisect, even though
+ # the failure was uninteresting.
+ #
# So, to make at least some progress on narrowing down the regression ...
# - look for the last commit that tested "good". If it's not $baseline_rev,
# then we have narrowed down the bisection range somewhat. Therefore,
diff --git a/round-robin.sh b/round-robin.sh
index a372aafb..2b0ab93f 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -239,8 +239,8 @@ build_abe ()
if [ x"$component" = x"check_gdb" ]; then
# Limit GDB testsuites to 16-thread parallelism. Running them
# with greater parallelism makes them too unstable.
- local cpus=$(cat abe/host.conf \
- | grep "^cpus=" | sed -e "s/^cpus=\(.*\)/\1/")
+ local cpus
+ cpus=$(cat abe/host.conf | grep "^cpus=" | sed -e "s/^cpus=\(.*\)/\1/")
if [ "$cpus" -gt 16 ]; then
cp abe/host.conf abe/host.conf.orig
sed -i -e "s/^cpus=.*/cpus=16/" abe/host.conf