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:
parent
8e66833886
commit
3d4eedeb11
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue