Skip to content

Commit 4b3d0bd

Browse files
committed
fix: address coderabbit review — remove stray files and clean up test
- Delete path/to/your/file.go (placeholder that caused typecheck lint failure) - Delete revert_commit.md (stray file) - Remove unused t *testing.T field from mockH2Transport struct - Add defer transport.Close() after Start() in regression test
1 parent 477922c commit 4b3d0bd

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

client/transport/streamable_http_bodyclose_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ func (r *blockingSSEReader) Read(p []byte) (int, error) {
107107
// mockH2Transport is an http.RoundTripper that simulates an HTTP/2 server
108108
// returning SSE responses with a body that exhibits the HTTP/2 Close() blocking
109109
// behavior when cs.donec can't close due to cc.wmu contention.
110-
type mockH2Transport struct {
111-
t *testing.T
112-
}
110+
type mockH2Transport struct{}
113111

114112
func (rt *mockH2Transport) RoundTrip(req *http.Request) (*http.Response, error) {
115113
// Parse the JSON-RPC request to get the ID.
@@ -165,7 +163,7 @@ func (rt *mockH2Transport) RoundTrip(req *http.Request) (*http.Response, error)
165163
//
166164
// defer func() { cancel(); resp.Body.Close() }()
167165
func TestStreamableHTTP_CloseBlocksBeforeCancel(t *testing.T) {
168-
mockTransport := &mockH2Transport{t: t}
166+
mockTransport := &mockH2Transport{}
169167
client := &http.Client{Transport: mockTransport}
170168

171169
// Use a dummy URL — the mock transport intercepts all requests.
@@ -174,6 +172,7 @@ func TestStreamableHTTP_CloseBlocksBeforeCancel(t *testing.T) {
174172
)
175173
require.NoError(t, err)
176174
require.NoError(t, transport.Start(context.Background()))
175+
defer transport.Close()
177176

178177
done := make(chan struct{})
179178
var sendErr error

path/to/your/file.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

revert_commit.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)