Skip to content

Commit efbd789

Browse files
committed
ci: fix flaky Windows integration tests
- Redirect spice run stdout/stderr to log files on Windows - Increase ready-check timeout from 60s to 120s - Fail the init step explicitly when the runtime never becomes ready - Add Windows-specific log collection step for post-test diagnostics
1 parent 33bc8f9 commit efbd789

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ jobs:
125125
spice init spice_qs
126126
cd spice_qs
127127
spice add spiceai/quickstart
128-
Start-Process -FilePath spice run
128+
Start-Process -FilePath spice -ArgumentList 'run' -RedirectStandardOutput spice.out.log -RedirectStandardError spice.err.log
129129
# Wait for runtime to be ready (poll /v1/ready endpoint)
130-
$timeout = 60
130+
$timeout = 120
131131
$elapsed = 0
132+
$ready = $false
132133
while ($elapsed -lt $timeout) {
133134
try {
134135
$response = Invoke-WebRequest -Uri "http://localhost:8090/v1/ready" -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop
135136
if ($response.StatusCode -eq 200) {
136137
Write-Host "Spice runtime is ready"
138+
$ready = $true
137139
break
138140
}
139141
} catch {
@@ -142,6 +144,13 @@ jobs:
142144
Start-Sleep -Seconds 1
143145
$elapsed++
144146
}
147+
if (-not $ready) {
148+
Write-Host "=== spice stdout log ==="
149+
if (Test-Path spice.out.log) { Get-Content spice.out.log }
150+
Write-Host "=== spice stderr log ==="
151+
if (Test-Path spice.err.log) { Get-Content spice.err.log }
152+
throw "Spice runtime did not become ready within $timeout seconds"
153+
}
145154
shell: pwsh
146155

147156
- name: Running tests
@@ -159,6 +168,18 @@ jobs:
159168
killall spice || true
160169
cat spice.log
161170
171+
- name: Stop spice and check logs (Windows)
172+
working-directory: spice_qs
173+
if: matrix.os == 'windows-latest' && always()
174+
run: |
175+
Get-Process -Name spice -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
176+
Get-Process -Name spiced -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
177+
Write-Host "=== spice stdout log ==="
178+
if (Test-Path spice.out.log) { Get-Content spice.out.log }
179+
Write-Host "=== spice stderr log ==="
180+
if (Test-Path spice.err.log) { Get-Content spice.err.log }
181+
shell: pwsh
182+
162183
pytest-cloud:
163184
runs-on: ubuntu-latest
164185
strategy:

0 commit comments

Comments
 (0)