Skip to content

Commit

Permalink
chore: test effect of constant transport
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed May 29, 2024
1 parent af4b8ac commit ff48d18
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions pkg/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,6 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket.
t.Cleanup(ts.Close)

var (
httpClient = &http.Client{
Transport: web.RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
u, err := url.Parse(ts.URL + r.URL.String())
if err != nil {
return nil, err
}
r.URL = u
return ts.Client().Transport.RoundTrip(r)
}),
}
conn *websocket.Conn
err error
)

if !o.DebugAPI {
httpClient = &http.Client{
Transport: web.RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
requestURL := r.URL.String()
Expand All @@ -285,7 +270,9 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket.
return transport.RoundTrip(r)
}),
}
}
conn *websocket.Conn
err error
)

if o.WsPath != "" {
u := url.URL{Scheme: "ws", Host: ts.Listener.Addr().String(), Path: o.WsPath}
Expand Down

0 comments on commit ff48d18

Please sign in to comment.