Skip to content

test(transport/http): add regression tests for streaming outliving server timeout - #3860

Open
ardi1s wants to merge 1 commit into
go-kratos:mainfrom
ardi1s:test/issue-3841-stream-timeout
Open

test(transport/http): add regression tests for streaming outliving server timeout#3860
ardi1s wants to merge 1 commit into
go-kratos:mainfrom
ardi1s:test/issue-3841-stream-timeout

Conversation

@ardi1s

@ardi1s ardi1s commented Jul 28, 2026

Copy link
Copy Markdown

Description (what this PR does / why we need it):

Adds end-to-end regression tests verifying that the per-request server timeout does not tear down long-lived streaming connections (SSE and WebSocket), matching the gRPC transport where the stream server interceptor intentionally skips the timeout.

The functional fix was already delivered in #3843, which detaches the stream context from the per-request timeout context via context.WithoutCancel. However, the existing coverage (TestServerStreamDetachesServerTimeout) bypasses the server's filter() middleware by constructing the wrapper directly. These new tests exercise the full server stack — timeout filter → route → stream → real HTTP client — with a 100ms server timeout and a ~250ms stream, and they fail on pre-#3843 code (only 1 of 5 events received).

Which issue(s) this PR fixes (resolves / be part of):

resolves #3841

Other special notes for the reviewers:

Test-only change, no behavior modified. go test ./transport/http/..., go vet and gofmt are all clean.

…rver timeout

Add end-to-end regression tests verifying that the per-request server
timeout does not tear down long-lived streaming connections (SSE and
WebSocket), matching the gRPC transport where the stream server
interceptor intentionally skips the timeout.

The functional fix was delivered in go-kratos#3843 by detaching the stream
context from the per-request timeout context; these tests cover the
full server stack (timeout filter -> route -> stream -> real client),
which the existing unit test bypasses, and fail on pre-go-kratos#3843 code.

resolves go-kratos#3841
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(transport/http): server-side timeout kills streaming connections (SSE/WebSocket)

1 participant