mirror of
https://github.com/Monkopedia/rouse-context.git
synced 2026-12-03 03:44:54 +00:00
OAuthEndToEndTest's post-WS-handshake `delay(500)` was racing the relay's `SessionRegistry.insert` under CI load. When the AI client's TLS handshake landed before insertion completed, the relay fell through to the FCM-wake path, which fails with a network error in the test harness (no valid FCM auth), producing the SocketTimeoutException observed on main. Adds a per-subdomain `Notify` on `SessionRegistry` that `insert` fires on every registration. A new `/test/wait-session-registered` admin endpoint exposes `wait_until_registered`, which arms the notified future via `enable()` (closing the classic notify-between-check-and-await gap) and awaits it with a timeout. OAuthEndToEndTest now opts into test-mode and calls `waitForSessionRegistered` instead of sleeping. Mirrors the `CompletableDeferred`-based signal pattern from #341. Verified with 95 consecutive passes (50 normal, 45 under `stress-ng --cpu 6..8`). Previous runs reproduced intermittent failures under CPU stress. Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src/main/kotlin/com/rousecontext/tunnel/integration | ||
| build.gradle.kts | ||