diff --git a/backend/internal/service/gemini_sse_comment_compat_test.go b/backend/internal/service/gemini_sse_comment_compat_test.go index 360f51ad38..c53e18ca0c 100644 --- a/backend/internal/service/gemini_sse_comment_compat_test.go +++ b/backend/internal/service/gemini_sse_comment_compat_test.go @@ -81,7 +81,11 @@ func runAntigravityGeminiStreamWithIdle(t *testing.T, userAgent string, idle tim } func TestAntigravityGeminiStreamKeepsCommentKeepaliveForOrdinaryClients(t *testing.T) { - out := runAntigravityGeminiStreamWithIdle(t, "curl/8.7.1", 1200*time.Millisecond) + // The keepalive interval is configured in whole seconds. Leave enough idle + // time for the first data event to be processed before the ticker fires; + // otherwise a busy CI runner can consume the first tick too early and close + // the stream before any heartbeat is written. + out := runAntigravityGeminiStreamWithIdle(t, "curl/8.7.1", 2200*time.Millisecond) require.Contains(t, out, ":\n\n", "ordinary clients should still get the idle keepalive") require.Contains(t, out, `"text":"partial"`) }