Skip to content

Commit 9068011

Browse files
committed
Clean up existing Named Pipe socket files before test
1 parent 0c55df9 commit 9068011

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/cross-platform-test.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,30 @@ jobs:
267267
Write-Host " Killing PID $($_.Id)"
268268
$_ | Stop-Process -Force -ErrorAction SilentlyContinue
269269
}
270-
Start-Sleep -Seconds 1
270+
Start-Sleep -Seconds 2
271271
} else {
272272
Write-Host "No other pwsh processes found"
273273
}
274274
275+
# Clean up any existing Named Pipe socket files (Linux/macOS)
276+
if (-not $IsWindows) {
277+
$pipeFile = "/tmp/CoreFxPipe_PowerShell.MCP.Communication"
278+
if (Test-Path $pipeFile) {
279+
Write-Host "Removing existing Named Pipe socket: $pipeFile"
280+
Remove-Item $pipeFile -Force -ErrorAction SilentlyContinue
281+
Start-Sleep -Seconds 1
282+
}
283+
}
284+
285+
# Verify Named Pipe is gone
286+
$pipeName = "PowerShell.MCP.Communication"
287+
if ($IsWindows) {
288+
$pipeExists = Test-Path "\\.\pipe\$pipeName"
289+
} else {
290+
$pipeExists = Test-Path "/tmp/CoreFxPipe_$pipeName"
291+
}
292+
Write-Host "Named Pipe exists before starting background pwsh: $pipeExists"
293+
275294
# Start a background pwsh process with PowerShell.MCP imported
276295
Write-Host "Starting background pwsh with PowerShell.MCP..."
277296
$bgPsi = [System.Diagnostics.ProcessStartInfo]::new()

0 commit comments

Comments
 (0)