File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8383
8484 - name : test
8585 run : |
86- export PATH=$GITHUB_WORKSPACE/qemu-install/bin/:$PATH
87- qemu-riscv64 ./utest/openblas_utest
88- qemu-riscv64 ./utest/openblas_utest_ext
86+ run_with_retry() {
87+ local cmd="$1"
88+ local time_out=10
89+ local retries=10
90+ local attempt=0
91+
92+ for ((i=1; i<=retries; i++)); do
93+ attempt=$((i))
94+ if timeout -s 12 --preserve-status $time_out $cmd; then
95+ echo "Command succeeded on attempt $i."
96+ return 0
97+ else
98+ local exit_code=$?
99+ if [ $exit_code -eq 140 ]; then
100+ echo "Attempt $i timed out (retrying...)"
101+ time_out=$((time_out + 5))
102+ else
103+ echo "Attempt $i failed with exit code $exit_code. Aborting workflow."
104+ exit $exit_code
105+ fi
106+ fi
107+ done
108+ echo "All $retries attempts failed, giving up."
109+ echo "Final failure was due to timeout."
110+ echo "Aborting workflow."
111+ exit $exit_code
112+ }
113+ export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH
114+ which qemu-riscv64
115+ export QEMU_BIN=$(which qemu-riscv64)
116+ run_with_retry "$QEMU_BIN ./utest/openblas_utest"
117+ run_with_retry "$QEMU_BIN ./utest/openblas_utest_ext"
118+
89119 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat1
90120 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat1
91121 OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat1
You can’t perform that action at this time.
0 commit comments