summaryrefslogtreecommitdiff
path: root/tcwg_bmk-build.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2023-08-23 17:19:32 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2023-08-28 16:27:03 +0000
commit047232cc72abefd5b32a74a4252b8724a5877931 (patch)
tree6f37de8d30ae3f242e07e96487d0cfc20f567809 /tcwg_bmk-build.sh
parentc6da99305c3b2f7617d506a3f76695a2553162ae (diff)
tcwg_bmk-build.sh (benchmark): Improve wait cycle
Use jenkins json API to detect completion of tcwg-benchmark job (instead of parsing console output). In rare cases a build can fail without printing out "Finished: FAILURE" to the console. Change-Id: Ifdd746a71c6452ba8482a0edba957a1da3b2c30c
Diffstat (limited to 'tcwg_bmk-build.sh')
-rwxr-xr-xtcwg_bmk-build.sh36
1 files changed, 15 insertions, 21 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh
index 6dca2310..dae5dad8 100755
--- a/tcwg_bmk-build.sh
+++ b/tcwg_bmk-build.sh
@@ -299,42 +299,36 @@ benchmark ()
assert_with_msg "Benchmark build number should not be 0!" \
[ "$build_num" -gt "0" ]
- # The "build" output adds "Completed <build>" to the console output.
- # Strip this last line.
- head -n -1 $run_step_artifacts/benchmark-build.log \
- > $run_step_artifacts/benchmark.log
-
local build_status
local build_ret
while true; do
# Ssh connection to ci.linaro.org occasionally drops. We need
# to check whether benchmarking has finished, and, if not, continue
- # 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)
+ # waiting.
+ build_status=$(curl -s "https://ci.linaro.org/job/tcwg-benchmark/$build_num/api/json" \
+ | jq -r ".result")
case "$build_status" in
- "Finished: SUCCESS")
+ "null")
+ # Continue waiting
+ true
+ ;;
+ "SUCCESS")
build_ret=0
break
;;
- "Finished: "*)
- echo "# Benchmarking infra is offline:" >> ${rr[top_artifacts]}/results
+ *)
+ echo "# Benchmarking infra is offline:" \
+ >> ${rr[top_artifacts]}/results
echo "-$EXTERNAL_FAIL" >> ${rr[top_artifacts]}/results
build_ret=1
break
;;
esac
- # After ci.linaro.org update on 2021-10-11 behavior of console command
- # option has changed: before the update it exited immediately for finished builds,
- # and after the update "console" hangs indefinitely for finished builds.
- # We workaround this by using "timeout 1m".
- sleep 300
-
- (timeout 1m \
- ssh -p2222 -l $USER@linaro.org ci.linaro.org \
- console tcwg-benchmark $build_num || true) \
- | tee $run_step_artifacts/benchmark.log
+ # Wait by following console output
+ (ssh -p2222 -l $USER@linaro.org ci.linaro.org \
+ console tcwg-benchmark $build_num -f || true) \
+ | tee $run_step_artifacts/benchmark-wait.log
done
rm -rf "${rr[top_artifacts]}/annex"