This is an automated email from the ASF dual-hosted git repository.
FrankChen021 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 97fcd37ce72 ci: do not fail unit test jobs when the JFR profiler agent
cannot be downloaded (#20318)
97fcd37ce72 is described below
commit 97fcd37ce7259c1123e672dba296d1a1a3759d2f
Author: Frank Chen <[email protected]>
AuthorDate: Tue Sep 15 13:20:31 2026 +0800
ci: do not fail unit test jobs when the JFR profiler agent cannot be
downloaded (#20318)
* ci: do not fail unit test jobs when the JFR profiler agent cannot be
downloaded
The profiler agent is observability only. A transient CDN or TLS error while
downloading it (curl exit 35) currently aborts the whole test shard before
Maven starts, because the script runs under set -e.
Retry the download for all error types with bounded timeouts, fail on HTTP
errors, download to a temporary file so a partial jar is never used, and
fall
back to running the tests without the agent, emitting a workflow warning.
* Emit a truly empty JFR_PROFILER_ARG_LINE when profiling is disabled
The root pom defaults jfrProfilerArgLine to an empty value; writing a
literal
"" into GITHUB_ENV would forward two quote characters into the surefire
argLine.
---
.github/scripts/setup_test_profiling_env.sh | 48 +++++++++++++++++------------
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/.github/scripts/setup_test_profiling_env.sh
b/.github/scripts/setup_test_profiling_env.sh
index 0becd0cc257..cf483a304da 100755
--- a/.github/scripts/setup_test_profiling_env.sh
+++ b/.github/scripts/setup_test_profiling_env.sh
@@ -28,24 +28,34 @@ fi
if [[ "$1" -ge "17" ]];
then
- curl https://static.imply.io/cp/$JAR_INPUT_FILE -s -o $JAR_OUTPUT_FILE
-
- # Run 'java -version' and capture the output
- output=$(java -version 2>&1)
-
- # Extract the version number using grep and awk
- jvm_version=$(echo "$output" | grep "version" | awk -F '"' '{print $2}')
-
- shift
- tags="${@/#/-Djfr.profiler.tags.}"
-
- echo $ENV_VAR=-javaagent:"$PWD"/$JAR_OUTPUT_FILE \
- -Djfr.profiler.http.username=druid-ci \
- -Djfr.profiler.http.password=w3Fb6PW8LIo849mViEkbgA== \
- -Djfr.profiler.tags.project=druid \
- -Djfr.profiler.tags.jvm_version=$jvm_version \
- "${tags[@]}"
+ # The profiler agent is observability only. If it cannot be downloaded, run
the tests without it
+ # instead of failing the job or pointing -javaagent at a missing or partial
jar.
+ TMP_JAR="$JAR_OUTPUT_FILE.tmp"
+ if curl -sSf --retry 3 --retry-delay 5 --retry-all-errors --connect-timeout
15 --max-time 120 --retry-max-time 300 \
+ "https://static.imply.io/cp/$JAR_INPUT_FILE" -o "$TMP_JAR"; then
+ mv -f "$TMP_JAR" "$JAR_OUTPUT_FILE"
+
+ # Run 'java -version' and capture the output
+ output=$(java -version 2>&1)
+
+ # Extract the version number using grep and awk
+ jvm_version=$(echo "$output" | grep "version" | awk -F '"' '{print $2}')
+
+ shift
+ tags="${@/#/-Djfr.profiler.tags.}"
+
+ echo $ENV_VAR=-javaagent:"$PWD"/$JAR_OUTPUT_FILE \
+ -Djfr.profiler.http.username=druid-ci \
+ -Djfr.profiler.http.password=w3Fb6PW8LIo849mViEkbgA== \
+ -Djfr.profiler.tags.project=druid \
+ -Djfr.profiler.tags.jvm_version=$jvm_version \
+ "${tags[@]}"
+ else
+ # stdout is appended to $GITHUB_ENV by the caller, so diagnostics must go
to stderr.
+ echo "::warning::Failed to download the JFR profiler agent
($JAR_INPUT_FILE); running tests without profiling" >&2
+ rm -f "$TMP_JAR" "$JAR_OUTPUT_FILE"
+ echo "$ENV_VAR="
+ fi
else
- echo $ENV_VAR=\"\"
+ echo "$ENV_VAR="
fi
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]