Skip to content

test(cli): loosen flaky header-timeout no-abort case - #11685

Merged
marius-kilocode merged 1 commit into
mainfrom
sudsy-pin
Jun 25, 2026
Merged

test(cli): loosen flaky header-timeout no-abort case#11685
marius-kilocode merged 1 commit into
mainfrom
sudsy-pin

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The provider/header-timeout.test.ts suite intermittently fails one case on CI, and a recent attempt to stabilize it (c319334) didn't fully fix the flake.

Problem

The headerTimeout does not abort delayed SSE body after headers arrive test (the only case that expects the timeout to not fire) used a 50ms header window with a 250ms delayed body. On a loaded CI runner the in-process server's headers and SSE prelude don't reach the client within 50ms, so the header-timeout timer fires and aborts the stream. result.text then rejects instead of resolving to "late", and the file fails on both attempts.

The other two timing cases (chunkTimeout and headerTimeout aborts when headers don't arrive) want the timeout to fire, so CI slowness makes them more reliable, not less. Only this one race-fails.

Change

  • headerTimeout: 50 -> 500 (10x margin for CI jank)
  • body delay 250 -> 1000

The body still lands well past the header window, so the assertion keeps its meaning: a healthy stream whose body arrives after headers should not be aborted by the header timeout (the timer is cleared on header arrival). Both edited lines are in a shared upstream test file, so they carry kilocode_change markers.

Could not run the suite locally (worktree has no node_modules and this sandbox has no network to bun install); the change is two numeric literals with no typecheck/lint impact.

The headerTimeout 'does not abort delayed SSE body' test flakes on
loaded CI runners: its 50ms header window is too tight, so the
in-process server's headers/prelude don't arrive in time and the
timeout aborts the stream instead of letting the delayed body through.

Bump the headerTimeout to 500ms and the body delay to 1000ms, keeping
body > headerTimeout so the assertion stays meaningful (the body lands
past the header window but isn't aborted because the timer clears on
header arrival). The other timing tests are unchanged since they
expect the timeout to fire, so CI slowness makes them more reliable.
@kilo-code-bot

kilo-code-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • packages/opencode/test/provider/header-timeout.test.ts

Reviewed by gpt-5.4-20260305 · Input: 51.1K · Output: 4.8K · Cached: 404.2K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 1729258 into main Jun 25, 2026
23 checks passed
@marius-kilocode
marius-kilocode deleted the sudsy-pin branch June 25, 2026 11:15
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
test(cli): loosen flaky header-timeout no-abort case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants