Files
weichenandCursor 5856585d1d feat(ops): compose runner auth, upload MIME validation, and test soak
Wire RUNNER_AUTH_TOKEN through dev/test/main Compose, validate uploads
with extension whitelist and content sniffing, add readiness soak script
and short PG loop test, and require runner token in prod when URL is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00

34 lines
737 B
Go

package server_test
import (
"net/http"
"net/http/httptest"
"testing"
"time"
)
func TestPhase5_SoakReadinessLoop_Short(t *testing.T) {
pool := openPGPoolWithMigrations(t)
if pool == nil {
return
}
defer pool.Close()
handler, _ := setupPGGovernanceServer(t, pool)
const iterations = 8
var failures int
for i := 0; i < iterations; i++ {
req := httptest.NewRequest(http.MethodGet, "/api/v1/ready", nil)
rec := httptest.NewRecorder()
handler.ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
failures++
t.Logf("iteration %d: ready=%d body=%s", i, rec.Code, rec.Body.String())
}
time.Sleep(50 * time.Millisecond)
}
if failures > 0 {
t.Fatalf("readiness soak failures=%d/%d", failures, iterations)
}
}