Skip to content

Commit 46e5e34

Browse files
committed
ci(windows): try IPv4-only bind for redis in debug workflow
1 parent 7aebdee commit 46e5e34

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/workflows/unittest-windows-debug.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ jobs:
5858
$errFile = Join-Path $env:RUNNER_TEMP 'redis.stderr.log'
5959
Write-Host "Redirecting redis stdout to: $outFile"
6060
Write-Host "Redirecting redis stderr to: $errFile"
61-
$proc = Start-Process -FilePath $exe -ArgumentList '--port 6379 --bind 127.0.0.1 ::1' -RedirectStandardOutput $outFile -RedirectStandardError $errFile -WindowStyle Hidden -PassThru
62-
Write-Host "Started redis-server (pid=$($proc.Id)), waiting for it to accept connections..."
61+
$proc = Start-Process -FilePath $exe -ArgumentList '--port 6379 --bind 127.0.0.1' -RedirectStandardOutput $outFile -RedirectStandardError $errFile -WindowStyle Hidden -PassThru
62+
$pidFile = Join-Path $env:RUNNER_TEMP 'redis.pid'
63+
$proc.Id | Out-File -FilePath $pidFile -Encoding ascii
64+
Write-Host "Started redis-server (pid=$($proc.Id)), pid written to $pidFile, waiting for it to accept connections..."
6365
$ok = $false
6466
for ($i=0; $i -lt 30; $i++) {
6567
Start-Sleep -Seconds 1
@@ -87,9 +89,25 @@ jobs:
8789
- name: "Diagnostics: print redis status (quick)"
8890
shell: pwsh
8991
run: |
90-
Get-Process -Name redis* -ErrorAction SilentlyContinue | Format-Table -AutoSize
91-
netstat -ano | Select-String ":6379"
92-
if (Get-Command redis-cli -ErrorAction SilentlyContinue) { & redis-cli ping } else { Write-Host "redis-cli not found" }
92+
$outFile = Join-Path $env:RUNNER_TEMP 'redis.stdout.log'
93+
$errFile = Join-Path $env:RUNNER_TEMP 'redis.stderr.log'
94+
$pidFile = Join-Path $env:RUNNER_TEMP 'redis.pid'
95+
if (Test-Path $pidFile) {
96+
$pid = (Get-Content $pidFile -ErrorAction SilentlyContinue).Trim()
97+
Write-Host "Redis pid (from file): $pid"
98+
try { Get-Process -Id $pid -ErrorAction SilentlyContinue | Format-Table -AutoSize } catch {}
99+
} else {
100+
Write-Host "Redis pid file not found: $pidFile"
101+
}
102+
Write-Host "Netstat (port 6379):"
103+
netstat -ano | Select-String ":6379" || Write-Host "no netstat output"
104+
if (Get-Command redis-cli -ErrorAction SilentlyContinue) {
105+
try { $out = & redis-cli ping 2>&1; Write-Host "redis-cli ping -> $out" } catch { Write-Host "redis-cli ping failed: $_" }
106+
} else {
107+
Write-Host "redis-cli not found"
108+
}
109+
if (Test-Path $outFile) { Write-Host "--- redis stdout (tail) ---"; Get-Content $outFile -ErrorAction SilentlyContinue | Select-Object -Last 200 } else { Write-Host "redis stdout log not found: $outFile" }
110+
if (Test-Path $errFile) { Write-Host "--- redis stderr (tail) ---"; Get-Content $errFile -ErrorAction SilentlyContinue | Select-Object -Last 200 } else { Write-Host "redis stderr log not found: $errFile" }
93111
94112
- name: Run tests
95113
shell: pwsh

0 commit comments

Comments
 (0)