From 1e1c938903826a903a5a2c67b65b4e6a58465853 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 16:05:02 +0800 Subject: [PATCH 01/10] ci: slim down Rocky Linux build dependencies - Remove Development Tools and unnecessary packages - Install only JDK 8, git-core and zstd with weak dependencies disabled - Use C.utf8 to avoid installing glibc-langpack-en - Resolve and validate JAVA_HOME so Gradle no longer requires which --- .github/workflows/pr-build.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index c7a5a6f4160..625ed783fab 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -113,15 +113,26 @@ jobs: env: GRADLE_USER_HOME: /github/home/.gradle - LANG: en_US.UTF-8 - LC_ALL: en_US.UTF-8 + LANG: C.utf8 + LC_ALL: C.utf8 steps: - name: Install dependencies (Rocky 8 + JDK8) run: | set -euxo pipefail - dnf -y install java-1.8.0-openjdk-devel git wget unzip which jq bc curl glibc-langpack-en - dnf -y groupinstall "Development Tools" + # Rocky 8 already provides CA certificates, JNI runtime libraries, tar and gzip. + # Its built-in C.utf8 locale provides UTF-8 without an extra language pack. + # git-core provides checkout commands; zstd supports actions/cache compression. + dnf -y --setopt=install_weak_deps=False install \ + java-1.8.0-openjdk-devel git-core zstd + # Set JAVA_HOME so the Gradle wrapper does not need which. + javac_path=$(command -v javac) + javac_real=$(readlink -f "$javac_path") + jdk_bin=$(dirname "$javac_real") + jdk_home=$(dirname "$jdk_bin") + test -x "$jdk_home/bin/java" + test -x "$jdk_home/bin/javac" + printf 'JAVA_HOME=%s\n' "$jdk_home" >> "$GITHUB_ENV" - name: Checkout code uses: actions/checkout@v5 From 5707ef1c455b1a4ce496603e3c1bcb4d73218c8b Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 16:30:28 +0800 Subject: [PATCH 02/10] ci: upload unit test logs and JUnit reports for failure diagnosis - Collect tron-test.log, rotated logs and JUnit XML across five PR build jobs - Run artifact uploads even when preceding steps fail - Use distinct artifact names per job and matrix configuration - Retain artifacts for 7 days and warn when no files are found --- .github/workflows/pr-build.yml | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 625ed783fab..8189006452c 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -63,6 +63,18 @@ jobs: java -jar "$JAR" db archive -h java -jar "$JAR" keystore --help + - name: Upload unit test logs + if: always() + uses: actions/upload-artifact@v6 + with: + name: tron-test-logs-${{ github.job }}-jdk${{ matrix.java }}-${{ matrix.arch }} + path: | + **/logs/tron-test.log + **/logs/tron-test-*.log.zip + **/build/test-results/**/TEST-*.xml + if-no-files-found: warn + retention-days: 7 + build-ubuntu: name: Build ubuntu24 (JDK 17 / aarch64) if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'ubuntu' }} @@ -102,6 +114,18 @@ jobs: java -jar "$JAR" db archive -h java -jar "$JAR" keystore --help + - name: Upload unit test logs + if: always() + uses: actions/upload-artifact@v6 + with: + name: tron-test-logs-${{ github.job }} + path: | + **/logs/tron-test.log + **/logs/tron-test-*.log.zip + **/build/test-results/**/TEST-*.xml + if-no-files-found: warn + retention-days: 7 + docker-build-rockylinux: name: Build rockylinux (JDK 8 / x86_64) if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'rockylinux' }} @@ -168,6 +192,18 @@ jobs: - name: Test with RocksDB engine run: ./gradlew :framework:testWithRocksDb --no-daemon + - name: Upload unit test logs + if: always() + uses: actions/upload-artifact@v6 + with: + name: tron-test-logs-${{ github.job }} + path: | + **/logs/tron-test.log + **/logs/tron-test-*.log.zip + **/build/test-results/**/TEST-*.xml + if-no-files-found: warn + retention-days: 7 + docker-build-debian11: name: Build debian11 (JDK 8 / x86_64) if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'debian11' }} @@ -233,6 +269,18 @@ jobs: **/build/reports/jacoco/test/jacocoTestReport.xml if-no-files-found: error + - name: Upload unit test logs + if: always() + uses: actions/upload-artifact@v6 + with: + name: tron-test-logs-${{ github.job }} + path: | + **/logs/tron-test.log + **/logs/tron-test-*.log.zip + **/build/test-results/**/TEST-*.xml + if-no-files-found: warn + retention-days: 7 + coverage-base: name: Coverage Base (JDK 8 / x86_64) if: ${{ github.event_name == 'pull_request' }} @@ -293,6 +341,18 @@ jobs: **/build/reports/jacoco/test/jacocoTestReport.xml if-no-files-found: warn + - name: Upload unit test logs + if: always() + uses: actions/upload-artifact@v6 + with: + name: tron-test-logs-${{ github.job }} + path: | + **/logs/tron-test.log + **/logs/tron-test-*.log.zip + **/build/test-results/**/TEST-*.xml + if-no-files-found: warn + retention-days: 7 + coverage-gate: name: Coverage Gate needs: [docker-build-debian11, coverage-base] From 4b6cbf63a14705f6aa76fc5995fa16e218d3f230 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 16:35:22 +0800 Subject: [PATCH 03/10] ci: remove deleted multinode workflow from PR cancellation list Remove the stale integration-test-multinode.yml reference to avoid unnecessary API requests when cancelling workflows for closed PRs. --- .github/workflows/pr-cancel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-cancel.yml b/.github/workflows/pr-cancel.yml index 3213026d3f9..a4d46153d47 100644 --- a/.github/workflows/pr-cancel.yml +++ b/.github/workflows/pr-cancel.yml @@ -21,7 +21,6 @@ jobs: 'pr-build.yml', 'codeql.yml', 'integration-test-single-node.yml', - 'integration-test-multinode.yml', ]; const headSha = context.payload.pull_request.head.sha; const prNumber = context.payload.pull_request.number; From a22a2c7ad3ee3c458efc34b742baccae7f586e04 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 17:31:10 +0800 Subject: [PATCH 04/10] ci: capture Gradle console logs and upload HTML test reports - Save build, RocksDB test and coverage output with tee and plain console mode - Use Bash pipefail to preserve failures when capturing stdout and stderr - Include console logs and HTML test reports in diagnostic artifacts - Preserve existing test retry and base coverage failure policies --- .github/workflows/pr-build.yml | 80 +++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 8189006452c..b8056094ee1 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -52,7 +52,11 @@ jobs: restore-keys: macos26-${{ matrix.arch }}-gradle- - name: Build - run: ./gradlew clean build --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test run: | @@ -63,7 +67,7 @@ jobs: java -jar "$JAR" db archive -h java -jar "$JAR" keystore --help - - name: Upload unit test logs + - name: Upload test diagnostics if: always() uses: actions/upload-artifact@v6 with: @@ -72,6 +76,8 @@ jobs: **/logs/tron-test.log **/logs/tron-test-*.log.zip **/build/test-results/**/TEST-*.xml + **/build/reports/tests/** + ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -103,7 +109,11 @@ jobs: restore-keys: ubuntu24-aarch64-gradle- - name: Build - run: ./gradlew clean build --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test run: | @@ -114,7 +124,7 @@ jobs: java -jar "$JAR" db archive -h java -jar "$JAR" keystore --help - - name: Upload unit test logs + - name: Upload test diagnostics if: always() uses: actions/upload-artifact@v6 with: @@ -123,6 +133,8 @@ jobs: **/logs/tron-test.log **/logs/tron-test-*.log.zip **/build/test-results/**/TEST-*.xml + **/build/reports/tests/** + ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -178,7 +190,11 @@ jobs: run: ./gradlew --stop || true - name: Build - run: ./gradlew clean build --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test run: | @@ -190,9 +206,13 @@ jobs: java -jar "$JAR" keystore --help - name: Test with RocksDB engine - run: ./gradlew :framework:testWithRocksDb --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - - name: Upload unit test logs + - name: Upload test diagnostics if: always() uses: actions/upload-artifact@v6 with: @@ -201,6 +221,8 @@ jobs: **/logs/tron-test.log **/logs/tron-test-*.log.zip **/build/test-results/**/TEST-*.xml + **/build/reports/tests/** + ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -244,7 +266,11 @@ jobs: debian11-x86_64-gradle- - name: Build - run: ./gradlew clean build --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew clean build --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test run: | @@ -256,10 +282,18 @@ jobs: java -jar "$JAR" keystore --help - name: Test with RocksDB engine - run: ./gradlew :framework:testWithRocksDb --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew :framework:testWithRocksDb --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports - run: ./gradlew jacocoTestReport --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew jacocoTestReport --no-daemon --console=plain 2>&1 | tee ci-logs/coverage.log - name: Upload PR coverage reports uses: actions/upload-artifact@v6 @@ -269,7 +303,7 @@ jobs: **/build/reports/jacoco/test/jacocoTestReport.xml if-no-files-found: error - - name: Upload unit test logs + - name: Upload test diagnostics if: always() uses: actions/upload-artifact@v6 with: @@ -278,6 +312,8 @@ jobs: **/logs/tron-test.log **/logs/tron-test-*.log.zip **/build/test-results/**/TEST-*.xml + **/build/reports/tests/** + ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -324,14 +360,26 @@ jobs: # this PR. The only output we need from this job is the jacoco XML for # coverage diffing, so we must not let a stale test failure block it. continue-on-error: true - run: ./gradlew clean build --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew clean build --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/build.log - name: Test with RocksDB engine (base) continue-on-error: true - run: ./gradlew :framework:testWithRocksDb --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew :framework:testWithRocksDb --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports (base) - run: ./gradlew jacocoTestReport --no-daemon + shell: bash + run: | + set -euo pipefail + mkdir -p ci-logs + ./gradlew jacocoTestReport --no-daemon --console=plain 2>&1 | tee ci-logs/coverage.log - name: Upload base coverage reports uses: actions/upload-artifact@v6 @@ -341,7 +389,7 @@ jobs: **/build/reports/jacoco/test/jacocoTestReport.xml if-no-files-found: warn - - name: Upload unit test logs + - name: Upload test diagnostics if: always() uses: actions/upload-artifact@v6 with: @@ -350,6 +398,8 @@ jobs: **/logs/tron-test.log **/logs/tron-test-*.log.zip **/build/test-results/**/TEST-*.xml + **/build/reports/tests/** + ci-logs/*.log if-no-files-found: warn retention-days: 7 From 376780b00d570ac3343988f6c3a3bfadf62bf30f Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 17:34:29 +0800 Subject: [PATCH 05/10] test: remove automatic retries from framework tests Remove the test-retry plugin and retry configuration shared by test and testWithRocksDb so test failures fail the task without retrying. --- framework/build.gradle | 5 ----- 1 file changed, 5 deletions(-) diff --git a/framework/build.gradle b/framework/build.gradle index 8edd6714f95..f090b9646db 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -1,5 +1,4 @@ plugins { - id "org.gradle.test-retry" version "1.5.9" id "org.sonarqube" version "2.6" id "com.gorylenko.gradle-git-properties" version "2.4.1" } @@ -119,10 +118,6 @@ run { } def configureTestTask = { Task t -> - t.retry { - maxRetries = 5 - maxFailures = 20 - } t.testLogging { exceptionFormat = 'full' } From 679efc4f9e46fb585eb65c7f259e0fabb5f87283 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 19:44:35 +0800 Subject: [PATCH 06/10] ci: upload only essential logs on failure - Limit diagnostic artifacts to **/logs/tron-test.log and ci-logs/*.log - Upload logs only when a preceding step fails - Include base test failures tolerated by continue-on-error - Keep the existing 7-day retention period --- .github/workflows/pr-build.yml | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index b8056094ee1..ec301b26514 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -68,15 +68,12 @@ jobs: java -jar "$JAR" keystore --help - name: Upload test diagnostics - if: always() + if: failure() uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }}-jdk${{ matrix.java }}-${{ matrix.arch }} path: | **/logs/tron-test.log - **/logs/tron-test-*.log.zip - **/build/test-results/**/TEST-*.xml - **/build/reports/tests/** ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -125,15 +122,12 @@ jobs: java -jar "$JAR" keystore --help - name: Upload test diagnostics - if: always() + if: failure() uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} path: | **/logs/tron-test.log - **/logs/tron-test-*.log.zip - **/build/test-results/**/TEST-*.xml - **/build/reports/tests/** ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -213,15 +207,12 @@ jobs: ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Upload test diagnostics - if: always() + if: failure() uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} path: | **/logs/tron-test.log - **/logs/tron-test-*.log.zip - **/build/test-results/**/TEST-*.xml - **/build/reports/tests/** ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -304,15 +295,12 @@ jobs: if-no-files-found: error - name: Upload test diagnostics - if: always() + if: failure() uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} path: | **/logs/tron-test.log - **/logs/tron-test-*.log.zip - **/build/test-results/**/TEST-*.xml - **/build/reports/tests/** ci-logs/*.log if-no-files-found: warn retention-days: 7 @@ -355,6 +343,7 @@ jobs: coverage-base-x86_64-gradle- - name: Build (base) + id: base_build # Test failures on the base branch are tolerated: merge-order races can # leave the base with a pre-existing failing test that is unrelated to # this PR. The only output we need from this job is the jacoco XML for @@ -367,6 +356,7 @@ jobs: ./gradlew clean build --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/build.log - name: Test with RocksDB engine (base) + id: base_rocksdb_test continue-on-error: true shell: bash run: | @@ -390,15 +380,13 @@ jobs: if-no-files-found: warn - name: Upload test diagnostics - if: always() + # Preserve logs for test failures tolerated by continue-on-error above. + if: ${{ failure() || steps.base_build.outcome == 'failure' || steps.base_rocksdb_test.outcome == 'failure' }} uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} path: | **/logs/tron-test.log - **/logs/tron-test-*.log.zip - **/build/test-results/**/TEST-*.xml - **/build/reports/tests/** ci-logs/*.log if-no-files-found: warn retention-days: 7 From 0ecbf2d2171e1cafa235ac7bc2c61ae4b10430c8 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 9 Sep 2026 22:13:07 +0800 Subject: [PATCH 07/10] ci: increase Rocky download concurrency and retain retry config comments - Set DNF max_parallel_downloads to 10 for Rocky dependency installation - Restore the test-retry plugin and configuration as comments, keeping retries disabled --- .github/workflows/pr-build.yml | 3 ++- framework/build.gradle | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index ec301b26514..9ba1cdf55fc 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -153,7 +153,8 @@ jobs: # Rocky 8 already provides CA certificates, JNI runtime libraries, tar and gzip. # Its built-in C.utf8 locale provides UTF-8 without an extra language pack. # git-core provides checkout commands; zstd supports actions/cache compression. - dnf -y --setopt=install_weak_deps=False install \ + # Download more packages concurrently when mirror requests are slow. + dnf -y --setopt=install_weak_deps=False --setopt=max_parallel_downloads=10 install \ java-1.8.0-openjdk-devel git-core zstd # Set JAVA_HOME so the Gradle wrapper does not need which. javac_path=$(command -v javac) diff --git a/framework/build.gradle b/framework/build.gradle index f090b9646db..5e181f2f26d 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -1,4 +1,5 @@ plugins { + // id "org.gradle.test-retry" version "1.5.9" id "org.sonarqube" version "2.6" id "com.gorylenko.gradle-git-properties" version "2.4.1" } @@ -118,6 +119,10 @@ run { } def configureTestTask = { Task t -> + // t.retry { + // maxRetries = 5 + // maxFailures = 20 + // } t.testLogging { exceptionFormat = 'full' } From c1309b003f15e358c25e8595a1e2fa4af8beeaf8 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Fri, 18 Sep 2026 19:09:01 +0800 Subject: [PATCH 08/10] ci: abandon slow mirrors during Rocky dependency installation Set DNF minrate=256k and timeout=30 to abort persistently slow connections and allow fallback to another mirror. --- .github/workflows/pr-build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 9ba1cdf55fc..e6063a3bf3a 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -153,9 +153,13 @@ jobs: # Rocky 8 already provides CA certificates, JNI runtime libraries, tar and gzip. # Its built-in C.utf8 locale provides UTF-8 without an extra language pack. # git-core provides checkout commands; zstd supports actions/cache compression. - # Download more packages concurrently when mirror requests are slow. - dnf -y --setopt=install_weak_deps=False --setopt=max_parallel_downloads=10 install \ - java-1.8.0-openjdk-devel git-core zstd + # Abandon connections below 256 KiB/s for 30 seconds so DNF can try another mirror. + dnf -y \ + --setopt=install_weak_deps=False \ + --setopt=max_parallel_downloads=10 \ + --setopt=minrate=256k \ + --setopt=timeout=30 \ + install java-1.8.0-openjdk-devel git-core zstd # Set JAVA_HOME so the Gradle wrapper does not need which. javac_path=$(command -v javac) javac_real=$(readlink -f "$javac_path") From e6a0c8610591201af39cd6322806695897ea7282 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Wed, 23 Sep 2026 11:50:15 +0800 Subject: [PATCH 09/10] ci: respect Gradle build cache configuration Remove --no-build-cache from Debian and baseline coverage jobs to preserve the cache behavior introduced in #6938. --- .github/workflows/pr-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e6063a3bf3a..8d951ae4abe 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -266,7 +266,7 @@ jobs: run: | set -euo pipefail mkdir -p ci-logs - ./gradlew clean build --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/build.log + ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test run: | @@ -282,7 +282,7 @@ jobs: run: | set -euo pipefail mkdir -p ci-logs - ./gradlew :framework:testWithRocksDb --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/rocksdb-test.log + ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports shell: bash @@ -358,7 +358,7 @@ jobs: run: | set -euo pipefail mkdir -p ci-logs - ./gradlew clean build --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/build.log + ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Test with RocksDB engine (base) id: base_rocksdb_test @@ -367,7 +367,7 @@ jobs: run: | set -euo pipefail mkdir -p ci-logs - ./gradlew :framework:testWithRocksDb --no-daemon --no-build-cache --console=plain 2>&1 | tee ci-logs/rocksdb-test.log + ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports (base) shell: bash From 430e431c546e72d792e906d05d0d6806ba48f940 Mon Sep 17 00:00:00 2001 From: 3for <287494524@qq.com> Date: Sat, 10 Oct 2026 20:14:46 +0800 Subject: [PATCH 10/10] ci: improve diagnostic uploads on failure and cancellation - Upload diagnostics on failure or cancellation with a 4-minute timeout. - Add step timeouts to reserve time for diagnostic uploads. - Keep Gradle daemon shutdown failures non-fatal. - Retain job-level timeouts for base tests to avoid accepting a partial coverage baseline after a tolerated step timeout. - Preserve outcome checks for tolerated base test failures. --- .github/workflows/pr-build.yml | 38 +++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 8d951ae4abe..dc64727a0c4 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -20,6 +20,8 @@ concurrency: jobs: + # Bound build/test/report steps to leave time for diagnostics before the job limit. + # Uploads after job cancellation are best-effort only. build-macos: name: Build macos26 (JDK ${{ matrix.java }} / ${{ matrix.arch }}) if: ${{ github.event_name == 'pull_request' || inputs.job == 'all' || inputs.job == 'macos' }} @@ -52,6 +54,7 @@ jobs: restore-keys: macos26-${{ matrix.arch }}-gradle- - name: Build + timeout-minutes: 45 shell: bash run: | set -euo pipefail @@ -59,6 +62,7 @@ jobs: ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test + timeout-minutes: 2 run: | set -e JAR=plugins/build/libs/Toolkit.jar @@ -68,7 +72,8 @@ jobs: java -jar "$JAR" keystore --help - name: Upload test diagnostics - if: failure() + if: ${{ failure() || cancelled() }} + timeout-minutes: 4 uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }}-jdk${{ matrix.java }}-${{ matrix.arch }} @@ -106,6 +111,7 @@ jobs: restore-keys: ubuntu24-aarch64-gradle- - name: Build + timeout-minutes: 45 shell: bash run: | set -euo pipefail @@ -113,6 +119,7 @@ jobs: ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test + timeout-minutes: 2 run: | set -e JAR=plugins/build/libs/Toolkit.jar @@ -122,7 +129,8 @@ jobs: java -jar "$JAR" keystore --help - name: Upload test diagnostics - if: failure() + if: ${{ failure() || cancelled() }} + timeout-minutes: 4 uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} @@ -186,9 +194,12 @@ jobs: rockylinux-x86_64-gradle- - name: Stop Gradle daemon + timeout-minutes: 2 + continue-on-error: true run: ./gradlew --stop || true - name: Build + timeout-minutes: 30 shell: bash run: | set -euo pipefail @@ -196,6 +207,7 @@ jobs: ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test + timeout-minutes: 2 run: | set -e JAR=plugins/build/libs/Toolkit.jar @@ -205,6 +217,7 @@ jobs: java -jar "$JAR" keystore --help - name: Test with RocksDB engine + timeout-minutes: 10 shell: bash run: | set -euo pipefail @@ -212,7 +225,8 @@ jobs: ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Upload test diagnostics - if: failure() + if: ${{ failure() || cancelled() }} + timeout-minutes: 4 uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} @@ -262,6 +276,7 @@ jobs: debian11-x86_64-gradle- - name: Build + timeout-minutes: 30 shell: bash run: | set -euo pipefail @@ -269,6 +284,7 @@ jobs: ./gradlew clean build --no-daemon --console=plain 2>&1 | tee ci-logs/build.log - name: Toolkit jar smoke test + timeout-minutes: 2 run: | set -e JAR=plugins/build/libs/Toolkit.jar @@ -278,6 +294,7 @@ jobs: java -jar "$JAR" keystore --help - name: Test with RocksDB engine + timeout-minutes: 10 shell: bash run: | set -euo pipefail @@ -285,6 +302,7 @@ jobs: ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports + timeout-minutes: 5 shell: bash run: | set -euo pipefail @@ -292,6 +310,7 @@ jobs: ./gradlew jacocoTestReport --no-daemon --console=plain 2>&1 | tee ci-logs/coverage.log - name: Upload PR coverage reports + timeout-minutes: 2 uses: actions/upload-artifact@v6 with: name: jacoco-coverage-pr @@ -300,7 +319,8 @@ jobs: if-no-files-found: error - name: Upload test diagnostics - if: failure() + if: ${{ failure() || cancelled() }} + timeout-minutes: 4 uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }} @@ -347,6 +367,8 @@ jobs: restore-keys: | coverage-base-x86_64-gradle- + # Use the job timeout for both base test steps. A tolerated step timeout + # could let incomplete coverage become the comparison baseline. - name: Build (base) id: base_build # Test failures on the base branch are tolerated: merge-order races can @@ -370,6 +392,7 @@ jobs: ./gradlew :framework:testWithRocksDb --no-daemon --console=plain 2>&1 | tee ci-logs/rocksdb-test.log - name: Generate module coverage reports (base) + timeout-minutes: 5 shell: bash run: | set -euo pipefail @@ -377,6 +400,7 @@ jobs: ./gradlew jacocoTestReport --no-daemon --console=plain 2>&1 | tee ci-logs/coverage.log - name: Upload base coverage reports + timeout-minutes: 2 uses: actions/upload-artifact@v6 with: name: jacoco-coverage-base @@ -386,7 +410,11 @@ jobs: - name: Upload test diagnostics # Preserve logs for test failures tolerated by continue-on-error above. - if: ${{ failure() || steps.base_build.outcome == 'failure' || steps.base_rocksdb_test.outcome == 'failure' }} + if: >- + failure() || cancelled() || + steps.base_build.outcome == 'failure' || + steps.base_rocksdb_test.outcome == 'failure' + timeout-minutes: 4 uses: actions/upload-artifact@v6 with: name: tron-test-logs-${{ github.job }}