diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-10-22 15:41:28 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-10-22 15:47:51 +0000 |
commit | 270b40a92a824f7fa5d23ccb14339d2a1c72acc9 (patch) | |
tree | 4b530b9590d668ec6822b81be79bdf6f19565b6d /tcwg_bmk-build.sh | |
parent | 591f25a855eab54b67cd38c77d5a0f658573eea6 (diff) |
tcwg_bmk-build.sh: Update logic that waits for jenkins job completion
... following changed behavior of "console -f" from ci.linaro.org
update on 2021-10-11.
Change-Id: I6cc68f275c4e20cc7c67aac06ca6addd456117e7
Diffstat (limited to 'tcwg_bmk-build.sh')
-rwxr-xr-x | tcwg_bmk-build.sh | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index 86ed75dd..e4a347a7 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -274,7 +274,7 @@ benchmark () # shellcheck disable=SC2154 remote_exec "ci.linaro.org:2222::-l $USER@linaro.org" \ - build tcwg-benchmark -w \ + build tcwg-benchmark -f -v \ -p bmk_hw=$hw \ -p bench_list="$bench_list" \ -p cflags="$bmk_flags" \ @@ -291,24 +291,21 @@ benchmark () -p image_arch="$image_arch" \ ${scripts_branch+-p scripts_branch="$scripts_branch"} \ ${bmk_branch+-p bmk_branch="$bmk_branch"} \ - | tee $run_step_artifacts/benchmark-start.log + | tee $run_step_artifacts/benchmark.log local build_num - build_num=$(cat $run_step_artifacts/benchmark-start.log \ - | sed -e "s/.*#\([0-9]\+\).*/\1/") + build_num=$(head -n1 $run_step_artifacts/benchmark.log \ + | sed -e "s/Started.*#\([0-9]\+\).*/\1/") assert_with_msg "Benchmark build number should not be 0!" \ [ "$build_num" -gt "0" ] local build_status local build_ret while true; do - (remote_exec "ci.linaro.org:2222::-l $USER@linaro.org" \ - console tcwg-benchmark -n 1 -f $build_num || true) \ - | tee -a $run_step_artifacts/benchmark.log - # Ssh connection to ci.linaro.org occasionally drops. We need # to check whether benchmarking has finished, and, if not, continue - # to watch its output. + # to watch its output. We detect that the job has finished if the last + # line of console output is "Finished: <something>". build_status=$(tail -n 1 $run_step_artifacts/benchmark.log) case "$build_status" in "Finished: SUCCESS") @@ -323,9 +320,15 @@ benchmark () ;; esac - # Sleep a little to avoid flooding ci.linaro.org on transient ssh - # failures. - sleep 5 + # After ci.linaro.org update on 2021-10-11 behavior of console's "-f" + # option has changed -- for finished builds it exited immediately before + # the update, and after the update "console -f" hangs indefinitely. + # This makes us use busy-wait cycle here. + sleep 300 + + remote_exec "ci.linaro.org:2222::-l $USER@linaro.org" \ + console tcwg-benchmark $build_num \ + | tee $run_step_artifacts/benchmark.log done echo "$results_id" | sed -e "s/@build_num@/$build_num/g" \ |