From f2dd8b62312151487563f4deb6a166aef579cb26 Mon Sep 17 00:00:00 2001 From: "Evgeny @ SimpleX Chat" <259188159+evgeny-simplex@users.noreply.github.com> Date: Thu, 29 Oct 2026 22:08:01 +0000 Subject: [PATCH] ci: limit each test attempt to 35 minutes (#7900) * ci: limit each test attempt to 35 minutes * ci: reword the timed-out attempt line in the CI guide --- .github/workflows/build.yml | 2 +- scripts/ci/README.md | 2 +- scripts/ci/run-tests.sh | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f680c5fe88..c67f15ed46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -655,7 +655,7 @@ jobs: TESTS: ${{ github.event_name == 'workflow_dispatch' && inputs.tests || '' }} PR_BODY: ${{ github.event.pull_request.draft == true && github.event.pull_request.body || '' }} ATTEMPTS: ${{ (github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/tags/v')) && 3 || 1 }} - run: scripts/ci/run-tests.sh ./simplex-chat-test + run: scripts/ci/run-tests.sh timeout 35m ./simplex-chat-test # Compiling the desktop and Android targets of :common in parallel exceeds the 2 GB Kotlin daemon heap. # cmakeBuildAndCopy links the JNI library against libsimplex, which this job does not build. diff --git a/scripts/ci/README.md b/scripts/ci/README.md index 61370815ae..e6d645ff17 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -44,7 +44,7 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve - Docker image (step "Build and cache Docker image"); - caches (the steps "Restore ... from cache"); - `cabal build -j --enable-tests --ghc-options=-O0` (step "Build CLI"); - - simplex-chat-test with the selected tests (step "Run tests"). + - simplex-chat-test with the selected tests (step "Run tests"), each attempt limited to 35 minutes by `timeout`; an attempt that reaches the limit fails, and "Attempt timed out." is printed. - Local: ```sh cp scripts/cabal.project.local.linux cabal.project.local diff --git a/scripts/ci/run-tests.sh b/scripts/ci/run-tests.sh index ef7c92112c..bb8a98566c 100755 --- a/scripts/ci/run-tests.sh +++ b/scripts/ci/run-tests.sh @@ -26,7 +26,10 @@ attempts=${ATTEMPTS:-1} while [ "$i" -le "$attempts" ]; do if "$@" "${args[@]}"; then break - elif [ "$i" -lt "$attempts" ]; then + elif [ "$?" -eq 124 ]; then + echo "Attempt $i timed out." + fi + if [ "$i" -lt "$attempts" ]; then echo "Attempt $i failed, retrying..." sleep 1 fi