From 1dd17de09f1af614ebd9b29cf6db90f4ce9bf4cb Mon Sep 17 00:00:00 2001 From: Zhou Cheng Date: Sat, 9 Dec 2023 19:52:08 +0800 Subject: [PATCH] CI: set timeout for github actions (#4241) --- .github/scripts/command/quota.sh | 2 +- .github/scripts/command/sync_cluster.sh | 2 +- .github/workflows/aitests.yml | 4 +++- .github/workflows/chaos.yml | 4 +++- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/command.yml | 2 ++ .github/workflows/elastictest.yml | 2 ++ .github/workflows/encoding_mysql.yml | 2 ++ .github/workflows/filebench.yml | 1 + .github/workflows/fio_benchmark.yml | 2 ++ .github/workflows/fsrand.yml | 2 ++ .github/workflows/fsrand2.yml | 2 ++ .github/workflows/gateway.yml | 2 ++ .github/workflows/integrationtests.yml | 1 + .github/workflows/load.yml | 2 ++ .github/workflows/ltpfs.yml | 2 ++ .github/workflows/ltpsyscalls.yml | 2 ++ .github/workflows/misc.yml | 2 ++ .github/workflows/mongodb_mmap.yml | 2 ++ .github/workflows/mutate-test.yml | 2 ++ .github/workflows/mysqltest_bigtable.yml | 2 ++ .github/workflows/permission-check.yaml | 3 +++ .github/workflows/redis_compile.yml | 2 ++ .github/workflows/rmfiles.yml | 2 ++ .github/workflows/sdktest.yml | 1 + .github/workflows/storage.yml | 2 ++ .github/workflows/sysbench.yml | 2 ++ .github/workflows/tpcds.yml | 1 + .github/workflows/unittests.yml | 1 + .github/workflows/vdbench.yml | 2 ++ .github/workflows/verify.yml | 6 ++++++ .github/workflows/version_compatible_hypo.yml | 3 +++ 32 files changed, 64 insertions(+), 4 deletions(-) diff --git a/.github/scripts/command/quota.sh b/.github/scripts/command/quota.sh index c227bfdfa4e0..b7d14bf0ecac 100755 --- a/.github/scripts/command/quota.sh +++ b/.github/scripts/command/quota.sh @@ -55,7 +55,7 @@ test_total_inodes(){ sleep $((HEARTBEAT_INTERVAL+1)) set +x for i in {1001..2000}; do - echo $i | tee /jfs/test$i > /dev/null || (echo "df -i /jfs" && exit 1) + echo $i | tee /jfs/test$i > /dev/null || (df -i /jfs && ls /jfs/ -l | wc-l && exit 1) done set -x sleep $VOLUME_QUOTA_FLUSH_INTERVAL diff --git a/.github/scripts/command/sync_cluster.sh b/.github/scripts/command/sync_cluster.sh index 90035ddd33f3..7ab163e4c620 100755 --- a/.github/scripts/command/sync_cluster.sh +++ b/.github/scripts/command/sync_cluster.sh @@ -129,7 +129,7 @@ check_sync_log(){ [ -z "$count3" ] && count3=0 count1=$((file_count - count2 - count3)) echo "count1, $count1, count2, $count2, count3, $count3" - min_count=$((file_count / 10)) + min_count=$((file_count / 20)) # check if count1 is less than min_count if [ "$count1" -lt "$min_count" ] || [ "$count2" -lt "$min_count" ] || [ "$count3" -lt "$min_count" ]; then echo "count is less than min_count, $count1, $count2, $count3, $min_count" diff --git a/.github/workflows/aitests.yml b/.github/workflows/aitests.yml index b895a4ec225f..b4b65a17e5a3 100644 --- a/.github/workflows/aitests.yml +++ b/.github/workflows/aitests.yml @@ -19,6 +19,7 @@ on: jobs: aitests: + timeout-minutes: 90 strategy: fail-fast: false matrix: @@ -31,7 +32,8 @@ jobs: with: fetch-depth: 1 - - name: Build + - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Run Redis diff --git a/.github/workflows/chaos.yml b/.github/workflows/chaos.yml index 4b97f4697649..8548fe06bad1 100644 --- a/.github/workflows/chaos.yml +++ b/.github/workflows/chaos.yml @@ -19,6 +19,7 @@ on: jobs: chaos-test: + timeout-minutes: 60 runs-on: ubuntu-latest strategy: fail-fast: false @@ -37,7 +38,8 @@ jobs: go-version: 'oldstable' cache: true - - name: Build + - name: Build + timeout-minutes: 10 run: | sudo .github/scripts/apt_install.sh musl-tools upx-ucl export STATIC=1 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b033518d660e..8888a52e983c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,6 +27,7 @@ on: jobs: analyze: name: Analyze + timeout-minutes: 30 runs-on: ubuntu-20.04 permissions: actions: read diff --git a/.github/workflows/command.yml b/.github/workflows/command.yml index dd4b9b0b96e6..97060383c469 100644 --- a/.github/workflows/command.yml +++ b/.github/workflows/command.yml @@ -47,6 +47,7 @@ jobs: meta_matrix: ${{ steps.set-matrix.outputs.meta_matrix }} command_test1: + timeout-minutes: 60 needs: [build-matrix] strategy: fail-fast: true @@ -72,6 +73,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Test Config diff --git a/.github/workflows/elastictest.yml b/.github/workflows/elastictest.yml index dddf6cb21573..a577ad8aa6d6 100644 --- a/.github/workflows/elastictest.yml +++ b/.github/workflows/elastictest.yml @@ -25,6 +25,7 @@ on: jobs: elastictest: + timeout-minutes: 60 runs-on: ubuntu-20.04 steps: - name: Checkout @@ -33,6 +34,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Run Redis diff --git a/.github/workflows/encoding_mysql.yml b/.github/workflows/encoding_mysql.yml index b321d04e0137..7162ea35111d 100644 --- a/.github/workflows/encoding_mysql.yml +++ b/.github/workflows/encoding_mysql.yml @@ -11,6 +11,7 @@ on: jobs: mysql-encoding-test: + timeout-minutes: 30 runs-on: ubuntu-20.04 steps: - name: Checkout @@ -36,6 +37,7 @@ jobs: mv juicefs juicefs_old - name: Build new linux target + timeout-minutes: 10 uses: ./.github/actions/build - name: Init diff --git a/.github/workflows/filebench.yml b/.github/workflows/filebench.yml index 76a5bcb7b51c..cf90f092a017 100644 --- a/.github/workflows/filebench.yml +++ b/.github/workflows/filebench.yml @@ -27,6 +27,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Run Redis diff --git a/.github/workflows/fio_benchmark.yml b/.github/workflows/fio_benchmark.yml index 8d215429aa7c..72b73a394796 100644 --- a/.github/workflows/fio_benchmark.yml +++ b/.github/workflows/fio_benchmark.yml @@ -13,6 +13,7 @@ on: jobs: fio_benchmark: + timeout-minutes: 30 if: github.repository == 'juicedata/juicefs' runs-on: [ubuntu-20.04] @@ -38,6 +39,7 @@ jobs: cache: true - name: Build linux target + timeout-minutes: 10 run: | make juicefs diff --git a/.github/workflows/fsrand.yml b/.github/workflows/fsrand.yml index 87fd460d1ff8..2bc0bc386da5 100644 --- a/.github/workflows/fsrand.yml +++ b/.github/workflows/fsrand.yml @@ -18,6 +18,7 @@ on: jobs: fsrand: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -41,6 +42,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/fsrand2.yml b/.github/workflows/fsrand2.yml index 9fbf2d2d064c..297771348129 100644 --- a/.github/workflows/fsrand2.yml +++ b/.github/workflows/fsrand2.yml @@ -26,6 +26,7 @@ on: default: false jobs: fsrand2: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -49,6 +50,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/gateway.yml b/.github/workflows/gateway.yml index 7e09e85c1d9f..e3864853f10b 100644 --- a/.github/workflows/gateway.yml +++ b/.github/workflows/gateway.yml @@ -26,6 +26,7 @@ on: jobs: gateway: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -82,6 +83,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/integrationtests.yml b/.github/workflows/integrationtests.yml index ac516a2f0526..60a9151675c3 100644 --- a/.github/workflows/integrationtests.yml +++ b/.github/workflows/integrationtests.yml @@ -36,6 +36,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Copy diff --git a/.github/workflows/load.yml b/.github/workflows/load.yml index 872f1aa3ad8b..da41ebef420e 100644 --- a/.github/workflows/load.yml +++ b/.github/workflows/load.yml @@ -42,6 +42,7 @@ jobs: meta_matrix: ${{ steps.set-matrix.outputs.meta_matrix }} load: + timeout-minutes: 30 if: github.repository == 'juicedata/juicefs' needs: [build-matrix] strategy: @@ -79,6 +80,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/ltpfs.yml b/.github/workflows/ltpfs.yml index 93dfcc76fd3a..c8e951382549 100644 --- a/.github/workflows/ltpfs.yml +++ b/.github/workflows/ltpfs.yml @@ -18,6 +18,7 @@ on: jobs: ltpfs: + timeout-minutes: 60 runs-on: ubuntu-20.04 steps: - name: Checkout @@ -26,6 +27,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Copy diff --git a/.github/workflows/ltpsyscalls.yml b/.github/workflows/ltpsyscalls.yml index 836debe460b2..3964d8858909 100644 --- a/.github/workflows/ltpsyscalls.yml +++ b/.github/workflows/ltpsyscalls.yml @@ -24,6 +24,7 @@ on: jobs: ltpsyscalls: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -48,6 +49,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index 69db67430a16..d972356b6b2b 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -20,6 +20,7 @@ on: - cron: '0 0 * * *' jobs: misc-test: + timeout-minutes: 60 runs-on: ubuntu-20.04 services: redis: @@ -50,6 +51,7 @@ jobs: minio/minio server /data - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Install tool diff --git a/.github/workflows/mongodb_mmap.yml b/.github/workflows/mongodb_mmap.yml index 77eaf38f4b39..c2b04a82b0a3 100644 --- a/.github/workflows/mongodb_mmap.yml +++ b/.github/workflows/mongodb_mmap.yml @@ -25,6 +25,7 @@ on: jobs: mongodb_mmap: + timeout-minutes: 60 runs-on: ubuntu-20.04 steps: - name: Checkout @@ -33,6 +34,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Run Redis diff --git a/.github/workflows/mutate-test.yml b/.github/workflows/mutate-test.yml index be52170d4148..4043054c2a2e 100644 --- a/.github/workflows/mutate-test.yml +++ b/.github/workflows/mutate-test.yml @@ -105,6 +105,7 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} mutate-test: + timeout-minutes: 120 if: "!github.event.pull_request.draft" name: ${{matrix.test_file}} needs: build-matrix @@ -126,6 +127,7 @@ jobs: job_name: ${{matrix.test_file}} - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Remove problem matcher for go diff --git a/.github/workflows/mysqltest_bigtable.yml b/.github/workflows/mysqltest_bigtable.yml index e9ec0971cb7f..fa08822d85cc 100644 --- a/.github/workflows/mysqltest_bigtable.yml +++ b/.github/workflows/mysqltest_bigtable.yml @@ -18,6 +18,7 @@ on: jobs: mysqltest: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -30,6 +31,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Run Redis diff --git a/.github/workflows/permission-check.yaml b/.github/workflows/permission-check.yaml index 29acb9233c54..3ca7bbe983b8 100644 --- a/.github/workflows/permission-check.yaml +++ b/.github/workflows/permission-check.yaml @@ -29,6 +29,7 @@ on: jobs: pjdfstest: + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -48,7 +49,9 @@ jobs: - name: Set Variable id: vars run: echo "target=juicefs" >> $GITHUB_OUTPUT + - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/redis_compile.yml b/.github/workflows/redis_compile.yml index eb058ac49858..eaf0286a8405 100644 --- a/.github/workflows/redis_compile.yml +++ b/.github/workflows/redis_compile.yml @@ -18,6 +18,7 @@ on: jobs: rediscompile: + timeout-minutes: 30 runs-on: ubuntu-20.04 steps: - name: Checkout @@ -26,6 +27,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Setup minio diff --git a/.github/workflows/rmfiles.yml b/.github/workflows/rmfiles.yml index 5e21dee7dd8b..81aabd5843b3 100644 --- a/.github/workflows/rmfiles.yml +++ b/.github/workflows/rmfiles.yml @@ -13,6 +13,7 @@ on: jobs: rmr-test: + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -36,6 +37,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/sdktest.yml b/.github/workflows/sdktest.yml index 8886f75e62e0..9bd0f4ab8782 100644 --- a/.github/workflows/sdktest.yml +++ b/.github/workflows/sdktest.yml @@ -36,6 +36,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Set up Java diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 7f362847a08b..ea3ad7c2a5fb 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -23,6 +23,7 @@ on: jobs: storage: + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -56,6 +57,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: "$TARGET" diff --git a/.github/workflows/sysbench.yml b/.github/workflows/sysbench.yml index d45bbaeed257..94bf59275495 100644 --- a/.github/workflows/sysbench.yml +++ b/.github/workflows/sysbench.yml @@ -7,6 +7,7 @@ on: jobs: sysbench: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -37,6 +38,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/tpcds.yml b/.github/workflows/tpcds.yml index f5b2dcf0b3c7..85fd3b2b5fc0 100644 --- a/.github/workflows/tpcds.yml +++ b/.github/workflows/tpcds.yml @@ -51,6 +51,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build - name: Cache local Maven repository diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index d1cfd03407f0..7d39c53938d1 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -58,6 +58,7 @@ jobs: fetch-depth: 1 - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: useBeta: true diff --git a/.github/workflows/vdbench.yml b/.github/workflows/vdbench.yml index 21e576424d84..9dcce8ed2b99 100644 --- a/.github/workflows/vdbench.yml +++ b/.github/workflows/vdbench.yml @@ -7,6 +7,7 @@ on: jobs: vdbench: + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -29,6 +30,7 @@ jobs: fi - name: Build + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index f83418cd0e53..df1c5c0917f9 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -62,28 +62,34 @@ jobs: sudo .github/scripts/apt_install.sh g++-multilib gcc-mingw-w64 - name: Build linux target + timeout-minutes: 10 run: | make ./juicefs version - name: build lite + timeout-minutes: 10 run: | make juicefs.lite ./juicefs.lite version - name: build windows + timeout-minutes: 10 run: make juicefs.exe - name: build libjfs.dll + timeout-minutes: 10 run: make -C sdk/java/libjfs libjfs.dll - name: build ceph + timeout-minutes: 10 run: | sudo .github/scripts/apt_install.sh librados-dev make juicefs.ceph ./juicefs.ceph version - name: build fdb + timeout-minutes: 10 run: | wget https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb sudo dpkg -i foundationdb-clients_6.3.23-1_amd64.deb diff --git a/.github/workflows/version_compatible_hypo.yml b/.github/workflows/version_compatible_hypo.yml index 10317b1555b5..4e0125edb290 100644 --- a/.github/workflows/version_compatible_hypo.yml +++ b/.github/workflows/version_compatible_hypo.yml @@ -25,6 +25,7 @@ on: jobs: vc-hypo: + timeout-minutes: 120 continue-on-error: false strategy: fail-fast: false @@ -58,6 +59,7 @@ jobs: fi - name: Build new version + timeout-minutes: 10 uses: ./.github/actions/build with: target: ${{steps.vars.outputs.target}} @@ -69,6 +71,7 @@ jobs: path: ${{matrix.old_juicefs_version}} - name: Make old build + timeout-minutes: 10 run: | cd ${{matrix.old_juicefs_version}} if [ "${{matrix.meta}}" == "fdb" ]; then