This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch retry-if-pipe-failed
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2a4a6338f9f7ed3e5a978dc6d873592db72eaa26
Author: Steve Yurong Su <[email protected]>
AuthorDate: Thu Jan 2 12:36:06 2025 +0800

    Update pipe-it-2cluster.yml
---
 .github/workflows/pipe-it-2cluster.yml | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/pipe-it-2cluster.yml 
b/.github/workflows/pipe-it-2cluster.yml
index e235075dc7a..8ff1a23e5a1 100644
--- a/.github/workflows/pipe-it-2cluster.yml
+++ b/.github/workflows/pipe-it-2cluster.yml
@@ -59,14 +59,32 @@ jobs:
         # we do not compile client-cpp for saving time, it is tested in 
client.yml
         # we can skip influxdb-protocol because it has been tested separately 
in influxdb-protocol.yml
         run: |
-          mvn clean verify \
-          -P with-integration-tests \
-          -DskipUTs \
-          -DintegrationTest.forkCount=1 -DConfigNodeMaxHeapSize=256 
-DDataNodeMaxHeapSize=1024 -DDataNodeMaxDirectMemorySize=768 \
-          -DClusterConfigurations=${{ matrix.cluster }},${{ matrix.cluster }} \
-          -pl integration-test \
-          -am -PMultiClusterIT2AutoCreateSchema \
-          -ntp
+          retry() {
+            local -i max_attempts=3
+            local -i attempt=1
+            local -i retry_sleep=5
+
+            while [ $attempt -le $max_attempts ]; do
+               mvn clean verify \
+              -P with-integration-tests \
+              -DskipUTs \
+              -DintegrationTest.forkCount=1 -DConfigNodeMaxHeapSize=256 
-DDataNodeMaxHeapSize=1024 -DDataNodeMaxDirectMemorySize=768 \
+              -DClusterConfigurations=${{ matrix.cluster }},${{ matrix.cluster 
}} \
+              -pl integration-test \
+              -am -PMultiClusterIT2AutoCreateSchema \
+              -ntp && return 0
+            if [ $attempt -lt $max_attempts ]; then
+              echo "Test failed, attempt $attempt. Retrying in $retry_sleep 
seconds..."
+              sleep $retry_sleep
+            else
+              echo "Test failed after $max_attempts attempts."
+              return 1
+            fi
+          
+            attempt=$((attempt + 1))
+            done
+          }
+          retry
       - name: Upload Artifact
         if: failure()
         uses: actions/upload-artifact@v4

Reply via email to