From 7ea45a97505eb87557990f4f648b498a0b897856 Mon Sep 17 00:00:00 2001 From: Austen Stone Date: Mon, 12 Oct 2026 02:52:17 -0700 Subject: [PATCH] Add a job timeout to the shared test matrix workflow (#3762) Add a configurable job timeout to `swift_test_matrix.yml`. ### Motivation: Matrix jobs have no timeout, so a stalled nightly toolchain build runs until the 6-hour limit. From Sep 27 to Oct 10, apple/swift-nio-quic had 139 such jobs (about 50,000 runner minutes), all on Linux nightly-main legs. ### Modifications: Add a `timeout_minutes` input (default 120) and use it as the `execute-matrix` job timeout. ### Result: Stalled jobs are cancelled after 2 hours instead of 6. The longest successful matrix job I found was 81 minutes (grpc-swift-2 Examples), so current callers fit, and they can raise the limit if needed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/swift_test_matrix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/swift_test_matrix.yml b/.github/workflows/swift_test_matrix.yml index 732b707bd..400fce418 100644 --- a/.github/workflows/swift_test_matrix.yml +++ b/.github/workflows/swift_test_matrix.yml @@ -14,6 +14,10 @@ on: type: string description: "The test matrix definition." required: true + timeout_minutes: + type: number + description: "The maximum time in minutes each matrix job may run before it is cancelled." + default: 120 # We will cancel previously triggered workflow runs concurrency: @@ -24,6 +28,7 @@ jobs: execute-matrix: name: ${{ matrix.config.platform }} (${{ matrix.config.name }}) runs-on: ${{ matrix.config.runner }} + timeout-minutes: ${{ inputs.timeout_minutes }} strategy: fail-fast: false matrix: ${{ fromJson(inputs.matrix_string) }}