Skip to content

Commit dba18c6

Browse files
committed
Don't dump, just get stack traces...
1 parent 4553781 commit dba18c6

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

eng/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Param(
3737
# Workaround for DOTNET_HOST_PATH not being set by older MSBuild
3838
# Removal is tracked by https://github.com/microsoft/testfx/issues/6767
3939
if (-not $env:DOTNET_HOST_PATH) {
40-
$env:DOTNET_HOST_PATH = [System.IO.Path]::GetFullPath(Join-Path (Join-Path (Join-Path $PSScriptRoot '..') '.dotnet') 'dotnet')
40+
$env:DOTNET_HOST_PATH = [System.IO.Path]::GetFullPath((Join-Path (Join-Path (Join-Path $PSScriptRoot '..') '.dotnet') 'dotnet'))
4141
if (-not (Test-Path $env:DOTNET_HOST_PATH)) {
4242
$env:DOTNET_HOST_PATH = "$($env:DOTNET_HOST_PATH).exe"
4343
}

run.ps1

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ Start-Job { $global:PSScriptRoot = $using:PSScriptRoot; dotnet test --solution N
44

55
Write-Host "Started dotnet test"
66

7-
Import-Module "$PSScriptRoot/Microsoft.Diagnostics.NETCore.Client.dll"
7+
# Import-Module "$PSScriptRoot/Microsoft.Diagnostics.NETCore.Client.dll"
88

9-
$dir = "$PSScriptRoot/dumps"
9+
# $dir = "$PSScriptRoot/dumps"
1010

11-
Start-Sleep -Duration ([TimeSpan]::FromMinutes(20))
11+
dotnet tool install --global dotnet-stack
12+
13+
Start-Sleep -Duration ([TimeSpan]::FromMinutes(1))
1214

1315
Write-Host "Timedout!! Dumping now..."
1416

15-
New-Item -ItemType Directory -Path $dir -Force -ErrorAction Ignore
17+
# New-Item -ItemType Directory -Path $dir -Force -ErrorAction Ignore
1618

1719
Write-Host "Getting processes..."
1820

19-
$processes = Get-Process -Name "Microsoft.Testing*","MSTest*" -ErrorAction Ignore
21+
$processes = Get-Process -Name "Microsoft.Testing*","MSTest*","dotnet" -ErrorAction Ignore
2022

2123
Write-Host "Got processes..."
2224
Write-Host $processes
2325

26+
dotnet stack ps
27+
2428
if (-not $processes) {
2529
Write-Host "No processes found."
26-
Set-Content -Path "$dir/output.txt" -Value "No dotnet processes found".
2730
}
2831

2932
Write-Host "Iterating."
@@ -32,22 +35,21 @@ foreach ($process in $processes) {
3235
$name = "$($process.Id)_$($process.Name)"
3336

3437
Write-Host "Dumping $name"
35-
Set-Content -Path "$dir/$name.txt" -Value "Dumping $name"
3638

39+
dotnet stack report --process-id $process.Id
3740
try {
38-
$client = [Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient]::new($process.Id);
39-
$fullPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$dir/$name.dmp")
40-
$client.WriteDump("Triage", $fullPath, $true);
41-
Write-Host "Dump written"
41+
# $client = [Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient]::new($process.Id);
42+
# $fullPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$dir/$name.dmp")
43+
# $client.WriteDump("Triage", $fullPath, $true);
44+
# Write-Host "Dump written"
4245
try {
4346
$process.Kill()
4447
}
4548
catch {
46-
Add-Content -Path "$dir/$name.txt" -Value "$_"
49+
Write-Host "$_"
4750
}
4851
}
4952
catch {
50-
Add-Content -Path "$dir/$name.txt" -Value "$_"
51-
Write-Host "ERR DUMPING!!"
53+
Write-Host "$_"
5254
}
5355
}

0 commit comments

Comments
 (0)