Skip to content

test(providers): fail a hung stream test in one bound, not two - #659

Merged
rominf merged 1 commit into
mainfrom
test/providers-stream-tidy
Oct 14, 2026
Merged

rominf merged 1 commit into
mainfrom
test/providers-stream-tidy

Conversation

@rominf

@rominf rominf commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Follows up #527 (jussielo-amd's notes).

  • One timeout, not two: a client that never returns now fails in about 10 s instead of about 20 s, because the server wait is skipped once the client has timed out. I measured both with a client that never connects.
  • Shared helpers: the SSE property-test helpers now share one collect_events, and FirstCallInterrupted is folded into InterruptingReader. Removing the Interrupted retry still fails close_delimited_reader_retries_one_interrupted_read and the property.
  • Trailer read: the zero-chunk trailer read now explains why its result is ignored. By that point every event, [DONE] included, has already been delivered, so failing would throw away a complete answer.
  • Not restored: the summary: suffix stays out. fix(providers): end a local stream cut off before its final chunk #527 removed it on purpose (in 85058139) to clear CodeQL cleartext-logging alerts.

Verified locally:

  • fmt
  • tests for rocm --bin rocm, with the known timing flakes passing on re-run, and e2e-cucumber lib, plus feature_naming
  • both clippy invocations, on Linux and for x86_64-pc-windows-gnu

This is test-only, so no scenario.

The two truncated-stream loopback tests waited on the server thread for a
second `TRUNCATED_STREAM_BOUND` even after the client had already timed out,
so a client that never connected took ~20 s to fail. Wait on the server only
when the client returned; the client timeout is reported either way.

In the property tests, the three `*_events` helpers and
`events_for_whole_body` now share one `collect_events`, and
`FirstCallInterrupted` is `InterruptingReader` with an unbounded period
(the reader now interrupts its first read too, which the periodic property
also exercises).

Also say at the zero-chunk trailer read why its result is ignored: every
event has been delivered by then, so failing would discard a complete answer.

Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
@rominf
rominf requested a review from a team as a code owner October 13, 2026 18:12
@rominf
rominf requested a review from tomastola October 13, 2026 18:12

@juhovainio juhovainio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this with two independent passes (a blind fan-out correctness review plus a separate Standards/Spec pass). Both came back clean.

Traced the served_request_within_bound skip-on-timeout refactor and confirmed it's behavior-preserving on the client-returned path and correctly skips only the redundant second wait on the timeout path, matching the claimed speedup. The InterruptingReader/FirstCallInterrupted merge was independently verified (including an actual simulation) to reproduce the deleted type's behavior exactly, with no dangling references left anywhere. This is also a clean, complete closure of all four notes left on the predecessor PR #527, not unrelated scope bundling.

Only minor non-blocking notes: a slightly loosened panic-message distinction in a test helper, and a small duplicated 3-line shape between the two edited test functions - neither worth holding this up for.

One thing worth a look, not from this diff: "E2E tests (Strix Halo, WSL2)" is currently failing on an unexpected regression in comfyui-source-download-shows-live-progress (a download-progress timeout), which isn't on the known-flaky list and isn't the usual comfyui status-test flake. This PR only touches local-provider SSE parsing, nothing related to ComfyUI installs, so it looks unrelated - but flagging it in case it's a new flake worth tracking rather than assuming it's unrelated.

Approving - nothing in the diff itself blocks merge.

@rominf

rominf commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks. Both minor notes (the looser panic-message distinction in the helper, and the three-line shape repeated in the two edited tests) will go into a follow-up PR. The WSL2 comfyui-source-download-shows-live-progress failure is not from this PR. It also hit #557, which does not touch ComfyUI either. The mock lane stalls #661 tracks are the likely cause, and #662 fixes them.

@rominf
rominf added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@rominf
rominf added this pull request to the merge queue Oct 14, 2026
@rominf

rominf commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

The merge queue ejected this on chat-06 (chat-tool-definitions-accepted), main's harness timeout from #661, which this change does not touch. I re-queued it behind #662, which fixes that timeout, so its merge group now includes the fix.

Merged via the queue into main with commit 287e08a Oct 14, 2026
28 of 30 checks passed
@rominf
rominf deleted the test/providers-stream-tidy branch October 14, 2026 10:45
@rominf

rominf commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

The promised follow-up is #685.

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