mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-19 16:17:56 +00:00
test: stabilize Gemini keepalive test
This commit is contained in:
@@ -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"`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user