List dotnet processes about to be killed (#20526)

* List dotnet processes about to be killed

This should make it easier to see which test projects are failing to
terminate when troubleshooting test hangs.

* Enlongenate
This commit is contained in:
Ryan Nowak 2020-04-03 17:00:01 -07:00 committed by GitHub
parent 8e66833886
commit 3d4eedeb11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -38,6 +38,15 @@ function _killSeleniumTrackedProcesses() {
} }
} }
function _listProcesses($processName) {
$processes = Get-WmiObject win32_process -Filter "name like '%$processName'" -ErrorAction SilentlyContinue;
if ($processes) {
Write-Host "These processes will be killed..."
$processes | select commandline | Out-String -Width 800
}
}
_listProcesses dotnet
_kill dotnet.exe _kill dotnet.exe
_kill testhost.exe _kill testhost.exe
_kill iisexpress.exe _kill iisexpress.exe

View File

@ -1,4 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# list processes that would be killed so they appear in the log
p=$(pgrep dotnet)
if [ $? -eq 0 ]
then
echo "These processes will be killed..."
ps -p $p
fi
pkill dotnet || true pkill dotnet || true
exit 0 exit 0