Skip to content

Commit

Permalink
Merge pull request #127535 from mmorel-35/testifylint/[email protected]
Browse files Browse the repository at this point in the history
…/client-go

fix: enable contains rule from testifylint in module `k8s.io/client-go`

Kubernetes-commit: a9cc5030f82bb8cc85f432cf64d315f4583afd09
  • Loading branch information
k8s-publishing-bot committed Sep 28, 2024
2 parents 374753a + c2ecdf4 commit e2b5fa7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions transport/websocket/roundtripper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -70,7 +69,7 @@ func TestWebSocketRoundTripper_RoundTripperFails(t *testing.T) {
// Bad handshake means websocket server will not completely initialize.
_, err := webSocketServerStreams(req, w)
require.Error(t, err)
assert.True(t, strings.Contains(err.Error(), "websocket server finished before becoming ready"))
assert.ErrorContains(t, err, "websocket server finished before becoming ready")
}))
defer websocketServer.Close()

Expand All @@ -87,8 +86,8 @@ func TestWebSocketRoundTripper_RoundTripperFails(t *testing.T) {
_, err = rt.RoundTrip(req)
// Ensure a "bad handshake" error is returned, since requested protocol is not supported.
require.Error(t, err)
assert.True(t, strings.Contains(err.Error(), "websocket: bad handshake"))
assert.True(t, strings.Contains(err.Error(), "403 Forbidden"))
assert.ErrorContains(t, err, "websocket: bad handshake")
assert.ErrorContains(t, err, "403 Forbidden")
assert.True(t, httpstream.IsUpgradeFailure(err))
}

Expand Down

0 comments on commit e2b5fa7

Please sign in to comment.