rouse-context/core/testfixtures
Jason Monk b61b2f5015
Fix #377: Replace 500ms session-registration sleep with deterministic Notify signal (#399)
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>
2026-04-24 23:39:09 -04:00
..
src/main/kotlin/com/rousecontext/tunnel/integration Fix #377: Replace 500ms session-registration sleep with deterministic Notify signal (#399) 2026-04-24 23:39:09 -04:00
build.gradle.kts Fix #250: App-wired integration test scaffold (Robolectric + real Koin + TestRelayFixture) (#258) 2026-04-18 20:14:48 -04:00