test: stabilize Gemini keepalive test

This commit is contained in:
haruka
2026-09-20 15:04:15 +08:00
parent e509937382
commit 8f6bbb59c7
@@ -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"`)
}