diff options
Diffstat (limited to 'round-robin-baseline.sh')
-rwxr-xr-x | round-robin-baseline.sh | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/round-robin-baseline.sh b/round-robin-baseline.sh index 740ec514..02502612 100755 --- a/round-robin-baseline.sh +++ b/round-robin-baseline.sh @@ -312,6 +312,21 @@ rewrite_single_revision () echo "rr[patch]=${rr[patch]}" | manifest_out else # otherwise run the check_regression stage + + # FIXME: Workaround design bug that we are using artifacts/results + # as both an indicator of "interesting / non-interesting" build, + # and a result metric. + # The problem is that "$build_script __start_at check_regression" will + # re-write artifacts/results during "run_step" skipping, and we will + # always get an appearance of the full build if check_regression() is + # the first executed step. + # To workaround this we save/restore artifacts/results in + # round-robin-baseline.sh and check_regression(). + # Also see round-robin.sh:check_regression(). + if [ -f "$old_artifacts/results" ]; then + mv "$old_artifacts/results" "$old_artifacts/results.orig" + fi + $scripts/$build_script \ @@rr[top_artifacts] "$old_artifacts" __start_at check_regression \ "${fixup_opts[@]}" & @@ -319,8 +334,14 @@ rewrite_single_revision () fi if [ $res != 0 ]; then + # check_regression() can fail for ${old[update_baseline]}=="onsuccess" + # builds, and, in rare cases for ${old[update_baseline]}=="force" + # builds. So far we have encountered a case when "forced" entry + # fails due to corrupted data, which we happened to accept in the past. + # In this case we get $EXTERNAL_FAIL as the exit code. assert_with_msg "check_regression() failed on forced update_baseline" \ - [ "${old[update_baseline]}" = "onsuccess" ] + [ "${old[update_baseline]}" = "onsuccess" \ + -o "$res" = "$EXTERNAL_FAIL" ] if [ "${rr[major]-0}" -gt "${old[major]}" ]; then # $build_script [somewhat expectedly] failed to process old results, @@ -536,6 +557,9 @@ if $commit_artifacts; then update_baseline fi +# make sure base-artifact repository is clean to continue +git -C base-artifacts reset --hard + # Compute the maximum of revisions that we accept to remove. If we remove # more than we expected. This is suspicious, stop the rewriting process declare nb_revs nb_removed_revs @@ -587,7 +611,8 @@ while true; do echo -e "${BUILD_URL-}\nWARNING: failed rewriting base-artifacts" \ >> artifacts/jenkins/error-mail-body.txt fi - break + # If fail happens during a rewrite, we consider it as an internal_fail + exit $INTERNAL_FAIL fi if [ -f "${rr[top_artifacts]}/99-rewrite/more" ]; then @@ -603,7 +628,8 @@ while true; do echo -e "${BUILD_URL-}\nWARNING: Too many revisions removed while "\ "rewriting base-artifacts" >> artifacts/jenkins/error-mail-body.txt fi - break + # If fail happens during a rewrite, we consider it as an internal_fail + exit $INTERNAL_FAIL fi # Push current version and search for another revision to update. |