Skip to content

Commit bd02a50

Browse files
committed
ci: auto-comment on issue #2533 when windows-without-SSL job fails
Temporary instrumentation to track the intermittent windows-without-SSL failures reported in #2533. When the job fails on a push, it posts the run URL, commit, and per-shard failed-test lines as a comment on the issue, building up failure-pattern history automatically. This should be removed once the root cause is found and fixed.
1 parent 1c2607c commit bd02a50

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/test.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ jobs:
467467
468468
windows:
469469
runs-on: windows-latest
470+
permissions:
471+
contents: read
472+
issues: write
470473
if: >
471474
(github.event_name == 'push') ||
472475
(github.event_name == 'pull_request' &&
@@ -563,6 +566,30 @@ jobs:
563566
}
564567
if ($failed) { exit 1 }
565568
Write-Host "All shards passed."
569+
- name: Report flaky failure on issue #2533
570+
if: failure() && matrix.config.name == 'without SSL' && github.event_name == 'push'
571+
continue-on-error: true
572+
shell: pwsh
573+
working-directory: build/test
574+
env:
575+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
576+
run: |
577+
$summary = ""
578+
for ($i = 0; $i -lt 4; $i++) {
579+
$log = "shard_${i}.log"
580+
if (Test-Path $log) {
581+
$failedLines = Select-String -Path $log -Pattern "\[ FAILED \]"
582+
if ($failedLines) {
583+
$summary += "**Shard ${i}:**`n" + (($failedLines | ForEach-Object { $_.Line }) -join "`n") + "`n`n"
584+
}
585+
}
586+
}
587+
if (-not $summary) {
588+
$summary = "_Could not extract failed test name from shard logs; see the run for details._`n`n"
589+
}
590+
$runUrl = "$($env:GITHUB_SERVER_URL)/$($env:GITHUB_REPOSITORY)/actions/runs/$($env:GITHUB_RUN_ID)"
591+
$body = "Reoccurred on push: $runUrl`n`nCommit: $($env:GITHUB_SHA)`n`n$summary"
592+
gh issue comment 2533 --repo $env:GITHUB_REPOSITORY --body $body
566593
567594
env:
568595
VCPKG_ROOT: "C:/vcpkg"

0 commit comments

Comments
 (0)