|
58 | 58 | $errFile = Join-Path $env:RUNNER_TEMP 'redis.stderr.log' |
59 | 59 | Write-Host "Redirecting redis stdout to: $outFile" |
60 | 60 | 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..." |
63 | 65 | $ok = $false |
64 | 66 | for ($i=0; $i -lt 30; $i++) { |
65 | 67 | Start-Sleep -Seconds 1 |
|
87 | 89 | - name: "Diagnostics: print redis status (quick)" |
88 | 90 | shell: pwsh |
89 | 91 | 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" } |
93 | 111 |
|
94 | 112 | - name: Run tests |
95 | 113 | shell: pwsh |
|
0 commit comments