This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git
The following commit(s) were added to refs/heads/main by this push:
new 95f1768 Handle catestrophic autest failures (#380)
95f1768 is described below
commit 95f17689203aa739d9e266ffa05d48a587da81ec
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Jul 21 13:27:30 2025 -0400
Handle catestrophic autest failures (#380)
Our scripts currently rely upon a sandbox to detect if the autests
failed. However, this doesn't work if there is a fundamental issue, like
an exception, that prevents all autests from running and therefore
doesn't create a sandbox. We don't want CI to pass in these situations.
Co-authored-by: bneradt <[email protected]>
---
jenkins/branch/autest.pipeline | 11 +++++++++--
jenkins/github/autest.pipeline | 12 ++++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/jenkins/branch/autest.pipeline b/jenkins/branch/autest.pipeline
index 31be194..e43f466 100644
--- a/jenkins/branch/autest.pipeline
+++ b/jenkins/branch/autest.pipeline
@@ -151,8 +151,9 @@ pipeline {
autest_args="--ats-bin
/tmp/ats/bin/ --sandbox /tmp/sandbox"
fi
+ autest_failed=0
if [ ${SHARDCNT} -le 0 ]; then
- ./autest.sh
${autest_args} || true
+ ./autest.sh
${autest_args} || autest_failed=1
else
testsall=( $(
for el in
"${testsall[@]}" ; do
@@ -164,7 +165,7 @@ pipeline {
[ 0 -ne $((${ntests} %
${shardsize})) ] && shardsize=$((${shardsize} + 1))
shardbeg=$((${shardsize} * ${SHARD}))
sliced=${testsall[@]:${shardbeg}:${shardsize}}
- ./autest.sh
${autest_args} -f ${sliced[@]} || true
+ ./autest.sh
${autest_args} -f ${sliced[@]} || autest_failed=1
fi
if [ -n "$(ls -A
/tmp/sandbox/)" ]; then
@@ -173,6 +174,12 @@ pipeline {
ls "${export_dir}"
sudo chmod -R 777
${WORKSPACE}
exit 1
+ elif [ ${autest_failed} -ne 0
]; then
+ # No sandbox. Probably
a catestrophic failure, like an exception,
+ # that prevented
execution and the creation of a sandbox.
+ touch
${export_dir}/Autest_failures
+ sudo chmod -R 777
${WORKSPACE}
+ exit 1
else
touch
${export_dir}/No_autest_failures
sudo chmod -R 777
${WORKSPACE}
diff --git a/jenkins/github/autest.pipeline b/jenkins/github/autest.pipeline
index 7634c61..b67a4ac 100644
--- a/jenkins/github/autest.pipeline
+++ b/jenkins/github/autest.pipeline
@@ -146,8 +146,9 @@ pipeline {
autest_args="--ats-bin
/tmp/ats/bin/ --sandbox /tmp/sandbox"
fi
+ autest_failed=0
if [ ${SHARDCNT} -le 0 ]; then
- ./autest.sh
${autest_args} || true
+ ./autest.sh
${autest_args} || autest_failed=1
else
testsall=( $(
for el in
"${testsall[@]}" ; do
@@ -159,7 +160,7 @@ pipeline {
[ 0 -ne $((${ntests} %
${shardsize})) ] && shardsize=$((${shardsize} + 1))
shardbeg=$((${shardsize} * ${SHARD}))
sliced=${testsall[@]:${shardbeg}:${shardsize}}
- ./autest.sh
${autest_args} -f ${sliced[@]} || true
+ ./autest.sh
${autest_args} -f ${sliced[@]} || autest_failed=1
fi
@@ -169,6 +170,13 @@ pipeline {
ls "${export_dir}"
sudo chmod -R 777
${WORKSPACE}
exit 1
+ elif [ ${autest_failed} -ne 0
]; then
+ # No sandbox. Probably
a catestrophic failure, like an exception,
+ # that prevented
execution and the creation of a sandbox.
+ echo "AuTest failed."
+ touch
${export_dir}/Autest_failures
+ sudo chmod -R 777
${WORKSPACE}
+ exit 1
else
touch
${export_dir}/No_autest_failures
sudo chmod -R 777
${WORKSPACE}