test(transport/http): add regression tests for streaming outliving server timeout - #3860
Open
ardi1s wants to merge 1 commit into
Open
test(transport/http): add regression tests for streaming outliving server timeout#3860ardi1s wants to merge 1 commit into
ardi1s wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.