Skip to content

Commit

Permalink
Merge pull request #500 from testwill/pkg-import
Browse files Browse the repository at this point in the history
chore: pkg imported more than once
  • Loading branch information
k8s-ci-robot authored Jun 23, 2023
2 parents af3bfcd + a508b0e commit 6f42ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tests/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"google.golang.org/grpc/metadata"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client"
"sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics"
metricsclient "sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics"
clientmetricstest "sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics/testing"
clientproto "sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client"
Expand Down Expand Up @@ -359,7 +358,7 @@ func TestProxyDial_RequestCancelled_GRPC(t *testing.T) {
}
}()

if err := clientmetricstest.ExpectClientDialFailure(metrics.DialFailureContext, 1); err != nil {
if err := clientmetricstest.ExpectClientDialFailure(metricsclient.DialFailureContext, 1); err != nil {
t.Error(err)
}
if err := metricstest.ExpectServerDialFailure(metricsserver.DialFailureFrontendClose, 1); err != nil {
Expand Down Expand Up @@ -484,7 +483,7 @@ func TestProxyDial_AgentTimeout_GRPC(t *testing.T) {
t.Errorf("Unexpected error: %v", err)
}

if err := clientmetricstest.ExpectClientDialFailure(metrics.DialFailureEndpoint, 1); err != nil {
if err := clientmetricstest.ExpectClientDialFailure(metricsclient.DialFailureEndpoint, 1); err != nil {
t.Error(err)
}
if err := metricstest.ExpectServerDialFailure(metricsserver.DialFailureErrorResponse, 1); err != nil {
Expand Down
7 changes: 3 additions & 4 deletions tests/reconnect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/apiserver-network-proxy/proto/agent"
agentproto "sigs.k8s.io/apiserver-network-proxy/proto/agent"
"sigs.k8s.io/apiserver-network-proxy/proto/header"
)

func TestClientReconnects(t *testing.T) {
connections := make(chan struct{})
s := &testAgentServerImpl{
onConnect: func(stream agent.AgentService_ConnectServer) error {
onConnect: func(stream agentproto.AgentService_ConnectServer) error {
stream.SetHeader(metadata.New(map[string]string{
header.ServerID: uuid.Must(uuid.NewRandom()).String(),
header.ServerCount: "1",
Expand Down Expand Up @@ -89,9 +88,9 @@ func TestClientReconnects(t *testing.T) {
}

type testAgentServerImpl struct {
onConnect func(agent.AgentService_ConnectServer) error
onConnect func(agentproto.AgentService_ConnectServer) error
}

func (t *testAgentServerImpl) Connect(svr agent.AgentService_ConnectServer) error {
func (t *testAgentServerImpl) Connect(svr agentproto.AgentService_ConnectServer) error {
return t.onConnect(svr)
}

0 comments on commit 6f42ff3

Please sign in to comment.