From 2d51668ccb8619dc28e31d0a9bf0b217772ef40a Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Sun, 7 Jun 2026 10:17:35 +0800 Subject: [PATCH 1/2] ci: add retry for flaky network operations (cargo test, docker compose) --- .github/actions/test_behavior_core/action.yaml | 14 +++++++++++++- .../hdfs_native/hdfs_native_cluster/action.yml | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/actions/test_behavior_core/action.yaml b/.github/actions/test_behavior_core/action.yaml index 1ba9adf6859e..a756de25698b 100644 --- a/.github/actions/test_behavior_core/action.yaml +++ b/.github/actions/test_behavior_core/action.yaml @@ -41,7 +41,19 @@ runs: - name: Run Test Core shell: bash working-directory: core - run: cargo test behavior --features tests,${{ inputs.feature }} + run: | + # Retry cargo test up to 3 times to handle transient network issues + # when fetching crates from crates.io. + for i in $(seq 1 3); do + echo "--- cargo test behavior attempt $i/3 ---" + if cargo test behavior --features tests,${{ inputs.feature }}; then + exit 0 + fi + if [ "$i" -lt 3 ]; then + sleep $((i * 10)) + fi + done + exit 1 env: OPENDAL_TEST: ${{ inputs.service }} EOF diff --git a/.github/services/hdfs_native/hdfs_native_cluster/action.yml b/.github/services/hdfs_native/hdfs_native_cluster/action.yml index 5bf9e4e55e7f..8c4fa07a94a0 100644 --- a/.github/services/hdfs_native/hdfs_native_cluster/action.yml +++ b/.github/services/hdfs_native/hdfs_native_cluster/action.yml @@ -24,7 +24,20 @@ runs: - name: Setup HDFS Native cluster shell: bash working-directory: fixtures/hdfs - run: docker compose -f docker-compose-hdfs-cluster.yml up -d --wait + run: | + # Retry docker compose up to 3 times to handle transient network issues + # (e.g., Docker Hub pull timeouts). + for i in $(seq 1 3); do + echo "--- docker compose up attempt $i/3 ---" + if docker compose -f docker-compose-hdfs-cluster.yml up -d --wait; then + exit 0 + fi + if [ "$i" -lt 3 ]; then + sleep $((i * 10)) + docker compose -f docker-compose-hdfs-cluster.yml down 2>/dev/null || true + fi + done + exit 1 - name: Setup opendal env shell: bash run: | From f7b18e4c0001ee1386e3c83730f16a22cd94e132 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Sun, 7 Jun 2026 10:50:27 +0800 Subject: [PATCH 2/2] fix: quote heredoc delimiter to prevent bash expansion in generated action YAML --- .github/actions/test_behavior_core/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/test_behavior_core/action.yaml b/.github/actions/test_behavior_core/action.yaml index a756de25698b..225f1df6904b 100644 --- a/.github/actions/test_behavior_core/action.yaml +++ b/.github/actions/test_behavior_core/action.yaml @@ -32,7 +32,7 @@ runs: shell: bash run: | mkdir -p ./dynamic_test_core && - cat <./dynamic_test_core/action.yml + cat <<'EOF' >./dynamic_test_core/action.yml runs: using: composite steps: