Progmasoft Git

tazel

A build system for C, C++, Objective-C, Objective-C++ and Zig, with C# project files.

Clonegit clone https://git.progmasoft.com/tazel

Stop a hanging test run before the job's limit and keep its files

The macOS job ran into its 30-minute limit three times in its test step and
was cancelled, which loses the log and with it what HangDump wrote. The test
run now stops itself after 20 minutes (the platform's --timeout), within a
25-minute limit on the step, with the diagnostic log on; a failed or
cancelled run uploads its results, dumps and diagnostics for 14 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit
0114e9c105835a2acf7b370454e01e0aaec1823c
Author
Leitwolf11 ·
Parents
791cdc3276f2

Files · Download .tar.gz

Changes

 .github/workflows/ci.yml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fd7fa26..3ca3f17 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -99,10 +99,24 @@ jobs:
         run: dotnet build Tazel.slnx -c Release
 
       - name: Test
-        # A test that hangs for 15 minutes is dumped and named, instead of the job running into its timeout unnamed.
+        # A test that hangs is named and dumped at 15 minutes, and the run stops itself at 20, before the step's own
+        # limit, so the job ends with its log and its files kept instead of being cancelled at the job's limit.
+        timeout-minutes: 25
         run: >-
           dotnet test --solution Tazel.slnx -c Release --no-build --coverlet --coverlet-output-format cobertura
           --results-directory artifacts/coverage --hangdump --hangdump-timeout 15m --hangdump-type Mini
+          --timeout 20m --diagnostic --diagnostic-output-directory artifacts/diagnostics
+
+      - name: Keep what a failed run left
+        if: failure() || cancelled()
+        uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+        with:
+          name: test-run-${{ matrix.os }}
+          path: |
+            artifacts/coverage
+            artifacts/diagnostics
+          retention-days: 14
+          if-no-files-found: ignore
 
       - name: Run the built Tazel
         run: dotnet src/Progmasoft.Tazel/bin/Release/net10.0/tazel.dll version