From f86c9949af71cfe4e53c42fd4a5f2cd383ffbf54 Mon Sep 17 00:00:00 2001 From: rui cheng Date: Tue, 24 Nov 2026 22:18:51 +0800 Subject: [PATCH] ci: run the apple stress loop in its own job The loop starts 200 fresh processes and takes about 6m41s of the apple job's 12m05s, after which the job's other 37 steps take about 4 minutes. Run it in a job of its own so the two halves overlap. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 50 +++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bca03e6d..f9b421c0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -497,15 +497,6 @@ jobs: run: go tool nsgo test -ldflags '-s=false -w=false' ./internal/platform/apple -- -count=1 - name: Test widget and Live Activity recording run: go tool nsgo test -run '^(TestWidgetTimelines|TestLiveActivityRecords|TestUnavailableWidgetServices)$' ./nsgotest - # Load AuthenticationServices before playback, as in the failed suite (#801). - - name: Stress overlapping sound playback in fresh processes - env: - GOTRACEBACK: crash - run: | - for i in $(seq 1 200); do - go tool nsgo test -ldflags '-s=false -w=false' -run '^(TestAuthenticationServicesLoads|TestASoundDecodesOnceAndPlaysOverlapping)$' \ - ./internal/platform/apple -- -count=1 -timeout=30s || { echo "run $i failed"; exit 1; } - done - name: Test main-thread failure propagation run: go tool nsgo test -run '^TestOnMainExitPropagation$' ./internal/platform/macos -- -race - name: Test public unified-log diagnostics @@ -570,6 +561,47 @@ jobs: fi done + # The stress loop below starts a fresh process 200 times and takes about 6m41s, while the rest of the apple job takes about 4 minutes beside it. + apple-stress: + needs: changes + # Skips a pull request that cannot affect Apple's targets (apple-changes.yml); a failed changes job runs it. + if: ${{ !cancelled() && needs.changes.outputs.apple != 'false' }} + runs-on: depot-macos-26 + timeout-minutes: 30 + steps: + - name: Check out + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Go + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go.mod + cache: true + - name: Grant the runner the microphone + run: .github/scripts/grant-microphone.sh + - name: Mark the job's start for crash reports + run: touch "$RUNNER_TEMP/apple-start" + # Load AuthenticationServices before playback, as in the failed suite (#801). + - name: Stress overlapping sound playback in fresh processes + env: + GOTRACEBACK: crash + run: | + for i in $(seq 1 200); do + go tool nsgo test -ldflags '-s=false -w=false' -run '^(TestAuthenticationServicesLoads|TestASoundDecodesOnceAndPlaysOverlapping)$' \ + ./internal/platform/apple -- -count=1 -timeout=30s || { echo "run $i failed"; exit 1; } + done + - name: Print crash reports + if: failure() + run: | + # ReportCrash writes a report a few seconds after the process dies. + sleep 20 + for reports in "$HOME/Library/Logs/DiagnosticReports" /Library/Logs/DiagnosticReports; do + if [[ -d "$reports" ]]; then + find "$reports" -type f -newer "$RUNNER_TEMP/apple-start" \( -name '*.ips' -o -name '*.crash' \) -print -exec cat {} \; + fi + done + apple-simulator: needs: changes # Runs only in the merge queue, by hand and for a release, never on a pull request: the organization has one depot-macos-15 runner, and pull request runs queued ahead of merge groups made every group time out. A skipped job counts as passed, so the pull request still reaches the queue, and an Apple failure there removes it from the batch. In the queue it still skips a change that cannot affect Apple's targets (apple-changes.yml); a failed changes job runs it.