From 2adfc45838d607124cc5c022cc4aca8e8276c716 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 28 Aug 2026 18:39:53 -0400 Subject: [PATCH] Report a flaky failure only when the test step is what failed The reporting step for issue #2533 was gated on failure(), which is true when any step in the job failed. Two build failures on feature branches were posted to the issue as flaky test recurrences, with the body falling back to "Could not extract failed test name" because no test had run. Gate it on the test step's own conclusion instead, and skip posting when no [ FAILED ] line turns up in the shard logs. The explicit failure() stays because an if expression with no status check function gets an implicit success(). --- .github/workflows/test.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fab7a4a..5b9ac22 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -585,6 +585,7 @@ jobs: - name: Build ${{ matrix.config.name }} run: cmake --build build --config Release -- /v:m /clp:ShowCommandLine - name: Run tests ${{ matrix.config.name }} + id: run_tests if: ${{ matrix.config.run_tests }} shell: pwsh working-directory: build/test @@ -618,7 +619,10 @@ jobs: if ($failed) { exit 1 } Write-Host "All shards passed." - name: Report flaky failure on issue #2533 - if: failure() && matrix.config.name == 'without SSL' && github.event_name == 'push' + if: > + failure() && steps.run_tests.conclusion == 'failure' + && matrix.config.name == 'without SSL' + && github.event_name == 'push' continue-on-error: true shell: pwsh working-directory: build/test @@ -636,7 +640,8 @@ jobs: } } if (-not $summary) { - $summary = "_Could not extract failed test name from shard logs; see the run for details._`n`n" + Write-Host "No [ FAILED ] line in any shard log; not a test failure. Skipping the report." + exit 0 } $runUrl = "$($env:GITHUB_SERVER_URL)/$($env:GITHUB_REPOSITORY)/actions/runs/$($env:GITHUB_RUN_ID)" $body = "Reoccurred on push: $runUrl`n`nCommit: $($env:GITHUB_SHA)`n`n$summary"