Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gekko0114 committed May 1, 2023
1 parent 1a24c6c commit 9478a50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/autoscaler/statserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (s *Server) Handler(w http.ResponseWriter, r *http.Request) {
if err != nil {
// We close abnormally, because we're just closing the connection in the client,
// which is okay. There's no value delaying closure of the connection unnecessarily.
if err == io.ErrUnexpectedEOF {
if errors.Is(err, io.ErrUnexpectedEOF) {
s.logger.Debug("Handler disconnected")
} else {
s.logger.Errorf("Handler exiting on error: %#v", err)
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ package e2e

import (
"context"
"testing"

"github.com/gobwas/ws"
"golang.org/x/sync/errgroup"
"testing"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
3 changes: 2 additions & 1 deletion test/test_images/wsserver/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"errors"
"flag"
"io"
"log"
Expand Down Expand Up @@ -77,7 +78,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
if err != nil {
// We close abnormally, because we're just closing the connection in the client,
// which is okay. There's no value delaying closure of the connection unnecessarily.
if err == io.ErrUnexpectedEOF {
if errors.Is(err, io.ErrUnexpectedEOF) {
log.Println("Client disconnected.")
} else {
log.Println("Handler exiting on error:", err)
Expand Down

0 comments on commit 9478a50

Please sign in to comment.