Skip to content

Commit 4200689

Browse files
Collect a hang dump on the wedging Windows PowerShell CI leg
The `windows-latest` `CI Tests` leg still intermittently rides its `timeout-minutes` cap to a cancelled run even after #2318's skips. Pulling the test-result artifacts from the last two hung runs shows they stop right after `TestE2EPwsh` and never emit a `TestPS51` `.trx`, so the wedge is now in the net462 / Windows PowerShell 5.1 unit leg — not the E2E server path #2318 skipped. The earlier assumption in #2323 that `TestPS51` was unaffected no longer holds, and `dotnetTestArgs` had no `--blame-hang`, so a stuck unit host produced no dump and no test name; it just burned the hour. This doesn't skip anything — it instruments CI so the next hang is actionable: - Add `--blame-hang --blame-hang-timeout 10m --blame-hang-dump-type full` to the CI `dotnet test` invocations (gated to `GITHUB_ACTIONS`, so local runs are byte-identical). Any single test that wedges past 10 minutes is dumped and its host tree terminated, failing the leg fast and naming the test. - Install ProcDump (best-effort) on the Windows leg. VSTest's built-in hang dumper only handles .NET Core hosts, so dumping the net462 host needs ProcDump, which isn't on the runner image. A download failure only warns. - Upload `**/*.dmp` and `**/*_Sequence.xml` alongside the `.trx`. Caveat: if the wedge is in host startup/discovery rather than a running test, the per-test timer may not fire — but `_Sequence.xml` still shows how far discovery got. Once a hung run names the net462 test, we can give it the same targeted treatment as #2307 and #2314 instead of skipping the whole leg. Drafted by Copilot (Claude Opus 4.8). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0515a5f commit 4200689

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

‎.github/workflows/ci-test.yml‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,27 @@ jobs:
5252
shell: pwsh
5353
run: ./pwsh/tools/install-powershell.ps1 -Preview -Destination ./preview
5454

55+
- name: Install ProcDump for Windows PowerShell hang dumps
56+
if: runner.os == 'Windows'
57+
shell: pwsh
58+
run: |
59+
# VSTest's built-in hang dumper only handles .NET Core test hosts, so
60+
# capturing a dump of a wedged .NET Framework (net462 / Windows
61+
# PowerShell 5.1) test host requires ProcDump, which isn't on the
62+
# runner image. Install is best-effort: a failure must not fail CI
63+
# (the net8 legs dump without it, and `--blame-hang` still terminates
64+
# the host and writes a sequence file naming the hung test). See #2323.
65+
try {
66+
$zip = Join-Path $env:RUNNER_TEMP 'Procdump.zip'
67+
$dir = Join-Path $env:RUNNER_TEMP 'procdump'
68+
Invoke-WebRequest -Uri 'https://download.sysinternals.com/files/Procdump.zip' -OutFile $zip
69+
Expand-Archive -Path $zip -DestinationPath $dir -Force
70+
"PROCDUMP_PATH=$dir" | Out-File -FilePath $env:GITHUB_ENV -Append
71+
Write-Host "ProcDump installed to $dir"
72+
} catch {
73+
Write-Warning "ProcDump install failed; net462 hang dumps will be unavailable: $_"
74+
}
75+
5576
- name: Build and test
5677
shell: pwsh
5778
run: Invoke-Build -Configuration Release TestFull
@@ -79,4 +100,7 @@ jobs:
79100
if: always()
80101
with:
81102
name: PowerShellEditorServices-test-results-${{ matrix.os }}
82-
path: '**/*.trx'
103+
path: |
104+
**/*.trx
105+
**/*.dmp
106+
**/*_Sequence.xml

‎PowerShellEditorServices.build.ps1‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ $script:dotnetBuildArgs = @(
3232

3333
$script:dotnetTestArgs = @("test") + $script:dotnetBuildArgs + $TestArgs + @(
3434
if ($TestFilter) { "--filter", $TestFilter }
35+
# In CI, collect a hang dump and fail fast if any single test wedges instead
36+
# of riding the job's `timeout-minutes` cap blind. The Windows PowerShell 5.1
37+
# (net462) unit leg intermittently hangs under the 20260614 runner image; the
38+
# dump names the offending test and captures its stacks. See #2323.
39+
if ($env:GITHUB_ACTIONS) { "--blame-hang", "--blame-hang-timeout", "10m", "--blame-hang-dump-type", "full" }
3540
"--framework"
3641
)
3742

0 commit comments

Comments
 (0)