This is an automated email from the ASF dual-hosted git repository.
Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 0c495e609f fix(ci): retry Maven Central downloads and restore E2E
cache (#7781)
0c495e609f is described below
commit 0c495e609fd07c673055e221ada8ed70afff5649
Author: lymerin <[email protected]>
AuthorDate: Mon Oct 19 09:20:47 2026 +0800
fix(ci): retry Maven Central downloads and restore E2E cache (#7781)
---
.github/scripts/maven-with-retry-test.sh | 181 +++++++++++++++++++++
.github/scripts/maven-with-retry.sh | 103 ++++++++++++
.github/workflows/ci.yml | 6 +-
.github/workflows/e2e-k8s.yml | 22 ++-
.github/workflows/integrated-test.yml | 12 +-
.github/workflows/native-sql-matrix.yml | 2 +-
.../compose/script/e2e-springcloud-sync-compose.sh | 2 +-
.../compose/script/compose-script-test.sh | 2 +
.../compose/script/e2e-mysql-compose.sh | 2 +-
.../compose/script/e2e-websocket-sync-compose.sh | 2 +-
10 files changed, 316 insertions(+), 18 deletions(-)
diff --git a/.github/scripts/maven-with-retry-test.sh
b/.github/scripts/maven-with-retry-test.sh
new file mode 100644
index 0000000000..02b1cfa24a
--- /dev/null
+++ b/.github/scripts/maven-with-retry-test.sh
@@ -0,0 +1,181 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+readonly SCRIPT_DIR
+test_dir="$(mktemp -d)"
+trap 'rm -f "${test_dir}/"*; rmdir "${test_dir}"' EXIT
+export TEST_DIR="${test_dir}"
+export PATH="${test_dir}:${PATH}"
+export CANCEL_SLEEP=0
+
+cat > "${test_dir}/maven" <<'BASH'
+#!/usr/bin/env bash
+set -euo pipefail
+attempt=$(($(cat "${TEST_DIR}/count") + 1))
+echo "${attempt}" > "${TEST_DIR}/count"
+printf '%s\0' "$@" > "${TEST_DIR}/arguments"
+if [[ "${attempt}" -gt "${FAILURES}" ]]; then
+ echo '[INFO] BUILD SUCCESS'
+ exit 0
+fi
+cat "${TEST_DIR}/failure-${attempt}"
+exit 1
+BASH
+
+cat > "${test_dir}/sleep" <<'BASH'
+#!/usr/bin/env bash
+echo "$1" >> "${TEST_DIR}/delays"
+if [[ "${CANCEL_SLEEP}" -eq 1 ]]; then
+ kill -TERM "${PPID}"
+fi
+BASH
+chmod +x "${test_dir}/maven" "${test_dir}/sleep"
+
+cat > "${test_dir}/reset" <<'LOG'
+[ERROR] Failed to execute goal on project shenyu-examples-eureka: Could not
collect dependencies
+[ERROR] Failed to read artifact descriptor for
org.glassfish.jersey.core:jersey-client:jar:3.0.5
+[ERROR] Caused by: Could not transfer artifact
org.glassfish.jersey.core:jersey-client:pom:3.0.5 from/to central
(https://repo.maven.apache.org/maven2): Connection reset
+[ERROR] -> [Help 1]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
+LOG
+
+cat > "${test_dir}/parent" <<'LOG'
+[ERROR] The build could not read 1 project -> [Help 1]
+[ERROR] The project org.apache.shenyu:shenyu:2.7.2-SNAPSHOT
(/workspace/pom.xml) has 1 error
+[ERROR] Non-resolvable parent POM for org.apache.shenyu:shenyu:2.7.2-SNAPSHOT:
Could not transfer artifact org.apache:apache:pom:21 from/to central
(https://repo.maven.apache.org/maven2): status code: 429, reason phrase: Too
Many Requests (429) -> [Help 2]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
+[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
+LOG
+
+cat > "${test_dir}/compile" <<'LOG'
+[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:compile on project
shenyu-common: Compilation failure
+[ERROR] -> [Help 1]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
+LOG
+
+cat > "${test_dir}/wagon-502" <<'LOG'
+[ERROR] Failed to execute goal
org.jacoco:jacoco-maven-plugin:0.8.12:prepare-agent (default) on project
shenyu: Execution default of goal
org.jacoco:jacoco-maven-plugin:0.8.12:prepare-agent failed: Plugin
org.jacoco:jacoco-maven-plugin:0.8.12 or one of its dependencies could not be
resolved: Could not transfer artifact
org.apache.maven.shared:file-management:jar:3.1.0 from/to central
(https://repo.maven.apache.org/maven2): Transfer failed for
https://repo.maven.apache.org/maven2/org/apac [...]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
+LOG
+
+cat > "${test_dir}/tests" <<'LOG'
+[ERROR] Tests run: 8, Failures: 1, Errors: 0, Skipped: 0
+[ERROR] DividePluginTest.testDivide: expected 200 but received 502 Bad Gateway
+[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:test on project shenyu-common:
There are test failures.
+[ERROR] -> [Help 1]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
+LOG
+
+cat > "${test_dir}/missing" <<'LOG'
+[ERROR] Failed to execute goal on project
shenyu-spring-boot-starter-client-beat: Could not resolve dependencies
+[ERROR] Could not find artifact
org.apache.shenyu:shenyu-register-client-beat:jar:2.7.2-SNAPSHOT in
apache.snapshots (https://repository.apache.org/snapshots)
+[ERROR] -> [Help 1]
+[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
+LOG
+
+run_case() {
+ local name="$1" fixture="$2" failures="$3" expected_count="$4"
expected_status="$5"
+ local status=0
+ local attempt
+ echo 0 > "${test_dir}/count"
+ : > "${test_dir}/delays"
+ for attempt in 1 2 3; do
+ cp "${fixture}" "${test_dir}/failure-${attempt}"
+ done
+ FAILURES="${failures}" bash "${SCRIPT_DIR}/maven-with-retry.sh"
"${test_dir}/maven" \
+ '-Dmessage=two words' 'literal $(command); *' > "${test_dir}/output" 2>&1
|| status=$?
+ if [[ "${status}" -ne "${expected_status}" || "$(cat "${test_dir}/count")"
-ne "${expected_count}" ]]; then
+ echo "${name}: expected status/count ${expected_status}/${expected_count},
got ${status}/$(cat "${test_dir}/count")" >&2
+ cat "${test_dir}/output" >&2
+ exit 1
+ fi
+ echo "Passed: ${name}"
+}
+
+run_case success "${test_dir}/reset" 0 1 0
+# shellcheck disable=SC2016 # Command substitution must remain a literal
argument.
+printf '%s\0' '-Dmessage=two words' 'literal $(command); *' >
"${test_dir}/expected-arguments"
+cmp "${test_dir}/expected-arguments" "${test_dir}/arguments"
+[[ ! -s "${test_dir}/delays" ]]
+
+run_case reset "${test_dir}/reset" 1 2 0
+grep -Fq 'Connection reset' "${test_dir}/output"
+grep -Fq 'BUILD SUCCESS' "${test_dir}/output"
+run_case parent-429 "${test_dir}/parent" 1 2 0
+
+for reason in 'status code: 502, reason phrase: Bad Gateway (502)' 'status:
502 Bad Gateway' 'Return code is: 502, ReasonPhrase: Bad Gateway'; do
+ sed "s/Connection reset/${reason}/" "${test_dir}/reset" > "${test_dir}/http"
+ run_case "${reason}" "${test_dir}/http" 1 2 0
+done
+
+run_case wagon-502 "${test_dir}/wagon-502" 1 2 0
+
+# mvnd prefixes module output, and Maven can emit ANSI colors and CRLF.
+sed 's/^/[shenyu-examples-eureka] /' "${test_dir}/reset" >
"${test_dir}/prefixed"
+while IFS= read -r line; do
+ printf '\033[1;31m%s\033[0m\r\n' "${line}"
+done < "${test_dir}/prefixed" > "${test_dir}/colored"
+run_case colored-mvnd "${test_dir}/colored" 1 2 0
+
+run_case exhausted "${test_dir}/reset" 3 3 1
+printf '10\n20\n' > "${test_dir}/expected-delays"
+cmp "${test_dir}/expected-delays" "${test_dir}/delays"
+
+for fixture in compile tests missing; do
+ run_case "${fixture}" "${test_dir}/${fixture}" 3 1 1
+done
+sed 's/Connection reset/status code: 404, reason phrase: Not Found (404)/'
"${test_dir}/reset" > "${test_dir}/not-found"
+run_case http-404 "${test_dir}/not-found" 3 1 1
+sed 's/from\/to central (https:\/\/repo.maven.apache.org\/maven2)/from\/to
apache.snapshots (https:\/\/repository.apache.org\/snapshots)/' \
+ "${test_dir}/reset" > "${test_dir}/other-repository"
+run_case other-repository "${test_dir}/other-repository" 3 1 1
+
+# A reset in test output must not make a compiler failure retryable.
+cat "${test_dir}/reset" "${test_dir}/compile" > "${test_dir}/mixed"
+run_case mixed-failures "${test_dir}/mixed" 3 1 1
+cat "${test_dir}/tests" "${test_dir}/reset" > "${test_dir}/mixed"
+run_case mixed-failures-reversed "${test_dir}/mixed" 3 1 1
+
+# Multiple missing dependencies can belong to one terminal Maven error.
+sed '/^\[ERROR\] ->/i\[ERROR] Could not find artifact
org.apache.shenyu:missing:jar:2.7.2-SNAPSHOT' \
+ "${test_dir}/reset" > "${test_dir}/mixed-dependencies"
+run_case mixed-dependencies "${test_dir}/mixed-dependencies" 3 1 1
+sed '/^\[ERROR\] ->/i\[ERROR] Could not transfer artifact
org.example:other:pom:1 from/to central (https://repo.maven.apache.org/maven2):
status code: 404' \
+ "${test_dir}/reset" > "${test_dir}/mixed-transfers"
+run_case mixed-transfers "${test_dir}/mixed-transfers" 3 1 1
+
+# ProjectBuildingException also covers unrelated POM errors.
+sed 's/has 1 error/has 2 errors/' "${test_dir}/parent" >
"${test_dir}/invalid-model"
+echo '[ERROR] Unknown packaging: invalid' >> "${test_dir}/invalid-model"
+run_case invalid-model "${test_dir}/invalid-model" 3 1 1
+
+# A later attempt must not reuse the preceding attempt's transfer error.
+echo 0 > "${test_dir}/count"
+cp "${test_dir}/reset" "${test_dir}/failure-1"
+cp "${test_dir}/compile" "${test_dir}/failure-2"
+status=0
+FAILURES=3 bash "${SCRIPT_DIR}/maven-with-retry.sh" "${test_dir}/maven" >
"${test_dir}/output" 2>&1 || status=$?
+[[ "${status}" -eq 1 && "$(cat "${test_dir}/count")" -eq 2 ]]
+echo 'Passed: current-attempt-only'
+
+export CANCEL_SLEEP=1
+run_case cancellation "${test_dir}/reset" 3 1 143
+
+echo 'Maven transfer retry tests passed'
diff --git a/.github/scripts/maven-with-retry.sh
b/.github/scripts/maven-with-retry.sh
new file mode 100644
index 0000000000..529cf6e13d
--- /dev/null
+++ b/.github/scripts/maven-with-retry.sh
@@ -0,0 +1,103 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -euo pipefail
+
+log_file="$(mktemp)"
+trap 'rm -f "${log_file}"' EXIT
+trap 'exit 130' INT
+trap 'exit 143' TERM
+
+is_transfer_failure() {
+ awk '
+ function finish_error( count, transfers, i) {
+ if (error == "") {
+ return
+ }
+ errors++
+ count = split(error, transfers, /Could not transfer artifact /)
+ if (count < 2 || error ~ /Could not find artifact /) {
+ invalid = 1
+ }
+ for (i = 2; i <= count; i++) {
+ if (transfers[i] !~ /from\/to central
\(https:\/\/repo\.maven\.apache\.org\/maven2\)/ ||
+ (transfers[i] !~ /Connection reset|([Ss]tatus
code:|[Ss]tatus:|Return code is:)[ ]*(429|502)([^0-9]|$)/ &&
+ transfers[i] !~ /Transfer failed for
https:\/\/repo\.maven\.apache\.org\/maven2\/[^ ]+ 502 Bad Gateway/)) {
+ invalid = 1
+ }
+ }
+ error = ""
+ }
+ {
+ # Maven and mvnd both color and prefix their error output.
+ gsub(/\033\[[0-9;]*[mK]/, "")
+ sub(/\r$/, "")
+ if (!sub(/^.*\[ERROR\][ ]*/, "")) {
+ next
+ }
+ if ($0 ~ /^\[Help [0-9]+\] https?:\/\//) {
+ finish_error()
+ references++
+ if ($0 !~
/\/MAVEN\/(DependencyResolutionException|PluginResolutionException|ProjectBuildingException|UnresolvableModelException)$/)
{
+ invalid = 1
+ }
+ next
+ }
+ # Account for every POM error, including errors without a Help reference.
+ if ($0 ~ /^The project .* has [0-9]+ errors?$/) {
+ finish_error()
+ sub(/^.* has /, "")
+ model_errors += $1
+ next
+ }
+ if ($0 ~ /^(Failed to execute goal |Plugin .* could not be
resolved|Non-resolvable (parent|import) POM)/) {
+ finish_error()
+ if ($0 ~ /^Non-resolvable /) {
+ classified_model_errors++
+ }
+ error = $0
+ } else if (error != "") {
+ error = error " " $0
+ }
+ if ($0 ~ /-> \[Help [0-9]+\]/) {
+ finish_error()
+ }
+ }
+ END {
+ finish_error()
+ exit !(errors > 0 && references > 0 && !invalid && model_errors ==
classified_model_errors)
+ }
+ ' "${log_file}"
+}
+
+for attempt in 1 2 3; do
+ # Capture both statuses before another command replaces PIPESTATUS.
+ set +e
+ "$@" 2>&1 | tee "${log_file}"
+ statuses=("${PIPESTATUS[@]}")
+ set -e
+
+ if [[ "${statuses[0]}" -eq 0 ]]; then
+ exit "${statuses[1]}"
+ fi
+ if [[ "${statuses[0]}" -ne 1 || "${statuses[1]}" -ne 0 || "${attempt}" -eq 3
]] || ! is_transfer_failure; then
+ exit "${statuses[0]}"
+ fi
+
+ echo "Maven Central transfer failed; retrying in $((attempt * 10)) seconds
(${attempt}/3)." >&2
+ sleep "$((attempt * 10))"
+done
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c9d1a53cff..a1b9857d40 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,6 +71,8 @@ jobs:
- uses: actions/checkout@v3
- name: Test CI case resolver
run: bash .github/scripts/resolve-test-case-matrix-test.sh
+ - name: Test Maven transfer retries
+ run: bash .github/scripts/maven-with-retry-test.sh
- name: Test storage Compose healthchecks
run: bash
shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
- uses: ./actions/paths-filter
@@ -206,10 +208,10 @@ jobs:
if mvnd --version > /dev/null 2>&1; then
echo "Using mvnd for build"
- mvnd ${MAVEN_ARGS} ${MODULE_ARGS} test ${TEST_ARGS}
+ exec bash .github/scripts/maven-with-retry.sh mvnd ${MAVEN_ARGS}
${MODULE_ARGS} test ${TEST_ARGS}
else
echo "Falling back to maven wrapper"
- ./mvnw ${MAVEN_ARGS} ${MODULE_ARGS} test ${TEST_ARGS}
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw ${MAVEN_ARGS}
${MODULE_ARGS} test ${TEST_ARGS}
fi
build_local_repo:
diff --git a/.github/workflows/e2e-k8s.yml b/.github/workflows/e2e-k8s.yml
index c0b6775f8b..ea72398f4c 100644
--- a/.github/workflows/e2e-k8s.yml
+++ b/.github/workflows/e2e-k8s.yml
@@ -131,22 +131,32 @@ jobs:
echo "MVND_HOME=$HOME/.local/mvnd" >> $GITHUB_ENV
fi
+ - name: Restore ShenYu Maven Repos
+ id: restore-maven-cache
+ uses: actions/cache/restore@v3
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ runner.os }}-maven-
+
- name: Build with Maven
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
echo "Using mvnd for build"
- mvnd -B clean install -Prelease,docker -Dmaven.javadoc.skip=true
-Drat.skip=true -Dmaven.test.skip=true -Djacoco.skip=true -DskipITs -DskipTests
-T1C
+ exec bash .github/scripts/maven-with-retry.sh mvnd -B clean
install -Prelease,docker -Dmaven.javadoc.skip=true -Drat.skip=true
-Dmaven.test.skip=true -Djacoco.skip=true -DskipITs -DskipTests -T1C
else
echo "Falling back to maven wrapper"
if [[ "${{ runner.os }}" == "Windows" ]]; then
- ./mvnw.cmd -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Drat.skip=true -Dmaven.test.skip=true
-Djacoco.skip=true -DskipITs -DskipTests -T1C
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw.cmd -B
clean install -Prelease,docker -Dmaven.javadoc.skip=true -Drat.skip=true
-Dmaven.test.skip=true -Djacoco.skip=true -DskipITs -DskipTests -T1C
else
- ./mvnw -B clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Drat.skip=true -Dmaven.test.skip=true
-Djacoco.skip=true -DskipITs -DskipTests -T1C
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B clean
install -Prelease,docker -Dmaven.javadoc.skip=true -Drat.skip=true
-Dmaven.test.skip=true -Djacoco.skip=true -DskipITs -DskipTests -T1C
fi
fi
- name: Save ShenYu Maven Repos
+ if: steps.restore-maven-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/.m2/repository
@@ -338,13 +348,13 @@ jobs:
run: |
if mvnd --version > /dev/null 2>&1; then
echo "Using mvnd to build ${EXAMPLE_PROJECTS}"
- mvnd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -pl "${EXAMPLE_PROJECTS}" -am -f
./shenyu-examples/pom.xml
+ exec bash .github/scripts/maven-with-retry.sh mvnd -B clean
install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -pl
"${EXAMPLE_PROJECTS}" -am -f ./shenyu-examples/pom.xml
else
echo "Falling back to maven wrapper to build ${EXAMPLE_PROJECTS}"
if [[ "${{ runner.os }}" == "Windows" ]]; then
- ./mvnw.cmd -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -pl "${EXAMPLE_PROJECTS}" -am -f
./shenyu-examples/pom.xml
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw.cmd -B
clean install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -pl
"${EXAMPLE_PROJECTS}" -am -f ./shenyu-examples/pom.xml
else
- ./mvnw -B clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -pl "${EXAMPLE_PROJECTS}" -am -f
./shenyu-examples/pom.xml
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B clean
install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -pl
"${EXAMPLE_PROJECTS}" -am -f ./shenyu-examples/pom.xml
fi
fi
diff --git a/.github/workflows/integrated-test.yml
b/.github/workflows/integrated-test.yml
index ead01a2c63..3a608d7705 100644
--- a/.github/workflows/integrated-test.yml
+++ b/.github/workflows/integrated-test.yml
@@ -172,26 +172,26 @@ jobs:
run: |
if mvnd --version > /dev/null 2>&1; then
echo "Using mvnd for build"
- mvnd -B -T 1C clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ exec bash .github/scripts/maven-with-retry.sh mvnd -B -T 1C clean
install -Prelease,docker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
else
echo "Falling back to maven wrapper"
- ./mvnw -B -T 1C clean install -Prelease,docker
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -T 1C
clean install -Prelease,docker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
fi
- name: Build examples
shell: bash
run: |
if mvnd --version > /dev/null 2>&1; then
echo "Using mvnd for build examples"
- mvnd -B -T 1C clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ exec bash .github/scripts/maven-with-retry.sh mvnd -B -T 1C clean
install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -am -f
./shenyu-examples/pom.xml
else
echo "Falling back to maven wrapper for examples"
- ./mvnw -B -T 1C clean install -Pexample -Dmaven.javadoc.skip=true
-Dmaven.test.skip=true -am -f ./shenyu-examples/pom.xml
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -T 1C
clean install -Pexample -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -am -f
./shenyu-examples/pom.xml
fi
- name: Build integrated tests
shell: bash
# mvnd can report success while skipping this entire subreactor.
run: |
- ./mvnw -B -ntp -T 1C clean install -Pit -Dmaven.test.skip=true \
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -T 1C
clean install -Pit -Dmaven.test.skip=true \
-pl :${{ matrix.case }} -am -f ./shenyu-integrated-test/pom.xml
- name: Verify integrated test image
run: docker image inspect apache/${{ matrix.case }}:latest --format
'{{.Id}}'
@@ -206,7 +206,7 @@ jobs:
id: test
shell: bash
run: |
- ./mvnw -B -ntp -T 1C test -Pit -DfailIfNoTests=true \
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -T 1C
test -Pit -DfailIfNoTests=true \
-f ./shenyu-integrated-test/${{ matrix.case }}/pom.xml
continue-on-error: true
- name: Check test result
diff --git a/.github/workflows/native-sql-matrix.yml
b/.github/workflows/native-sql-matrix.yml
index fe429b1151..5c5477d2a6 100644
--- a/.github/workflows/native-sql-matrix.yml
+++ b/.github/workflows/native-sql-matrix.yml
@@ -76,7 +76,7 @@ jobs:
cache: maven
- name: Verify list/detail/export and index contracts
run: >-
- ./mvnw -B -ntp -pl shenyu-admin -am test
+ exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl
shenyu-admin -am test
-Dtest=PluginMapperTest,PluginServiceTest,PluginControllerTest,AdminQueryIndexTest,PluginIndexUpgradeContractTest,DataPermissionMapperTest,PermissionListenerIntegrationTest
-Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true
diff --git
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-spring-cloud/compose/script/e2e-springcloud-sync-compose.sh
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-spring-cloud/compose/script/e2e-springcloud-sync-compose.sh
index 7fc9332332..79407b365d 100644
---
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-spring-cloud/compose/script/e2e-springcloud-sync-compose.sh
+++
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-spring-cloud/compose/script/e2e-springcloud-sync-compose.sh
@@ -60,7 +60,7 @@ for sync in "${SYNC_ARRAY[@]}"; do
sleep 10s
## run e2e-test
- ./mvnw -B -f ./shenyu-e2e/pom.xml -pl
shenyu-e2e-case/shenyu-e2e-case-spring-cloud -am test
+ bash .github/scripts/maven-with-retry.sh ./mvnw -B -f ./shenyu-e2e/pom.xml
-pl shenyu-e2e-case/shenyu-e2e-case-spring-cloud -am test
# shellcheck disable=SC2181
if (($?)); then
echo "${sync}-sync-e2e-test failed"
diff --git
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
index 16f753993e..d8e2af4697 100644
---
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
+++
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
@@ -19,6 +19,7 @@
set -euo pipefail
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
+export
RETRY_SCRIPT="$SCRIPT_DIR/../../../../../.github/scripts/maven-with-retry.sh"
TEST_TMP=$(mktemp -d)
trap 'rm -f "$TEST_TMP/mvnw" "$TEST_TMP/trace"; rmdir "$TEST_TMP"' EXIT
export RUN_TRACE="$TEST_TMP/trace"
@@ -30,6 +31,7 @@ sleep() { :; }
docker() { return "${DOCKER_EXIT:-0}"; }
bash() {
case "$1" in
+ .github/scripts/maven-with-retry.sh) command bash "$RETRY_SCRIPT"
"${@:2}" ;;
*/storage_init_*.sh) return "${INIT_EXIT:-0}" ;;
*/healthcheck.sh)
test -f "$1" || return 99
diff --git
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
index 5e9d117d8c..0c63f8703e 100644
---
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
+++
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/e2e-mysql-compose.sh
@@ -47,7 +47,7 @@ fi
bash "$HEALTHCHECK_SCRIPT" mysql http://localhost:31095/actuator/health
http://localhost:31195/actuator/health
## run e2e-test
-if ! ./mvnw -B -f ./shenyu-e2e/pom.xml -pl
shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
+if ! bash .github/scripts/maven-with-retry.sh ./mvnw -B -f
./shenyu-e2e/pom.xml -pl shenyu-e2e-case/shenyu-e2e-case-storage -am test; then
dump_logs
exit 1
fi
diff --git
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-websocket/compose/script/e2e-websocket-sync-compose.sh
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-websocket/compose/script/e2e-websocket-sync-compose.sh
index 5f55416b89..bbc46807b5 100644
---
a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-websocket/compose/script/e2e-websocket-sync-compose.sh
+++
b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-websocket/compose/script/e2e-websocket-sync-compose.sh
@@ -41,7 +41,7 @@ for sync in "${SYNC_ARRAY[@]}"; do
sleep 10s
docker ps -a
## run e2e-test
- ./mvnw -B -f ./shenyu-e2e/pom.xml -pl
shenyu-e2e-case/shenyu-e2e-case-websocket -am test
+ bash .github/scripts/maven-with-retry.sh ./mvnw -B -f ./shenyu-e2e/pom.xml
-pl shenyu-e2e-case/shenyu-e2e-case-websocket -am test
# shellcheck disable=SC2181
if (($?)); then
echo "${sync}-sync-e2e-test failed"