Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: replace dial with newclient #7970

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updating error messages
  • Loading branch information
janardhankrishna-sai committed Dec 26, 2024
commit 0068eaaa2558eecd3ef0c60ba56966ff725aaaf9
2 changes: 1 addition & 1 deletion interop/alts/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func main() {
// Block until the server is ready.
conn, err := grpc.NewClient(*serverAddr, grpc.WithTransportCredentials(altsTC), grpc.WithBlock())
if err != nil {
logger.Fatalf("gRPC Client: NewClient() failed %v: %v", *serverAddr, err)
logger.Fatalf("gRPC Client: failed to create a client for server at %q: %v", *serverAddr, err)
}
defer conn.Close()
grpcClient := testgrpc.NewTestServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion interop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func main() {
}
conn, err := grpc.NewClient(serverAddr, opts...)
if err != nil {
logger.Fatalf("NewClient() failed: %v", err)
logger.Fatalf("Failed to create a client: %v", err)
}
defer conn.Close()
tc := testgrpc.NewTestServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion interop/grpclb_fallback/client_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func createTestConn() *grpc.ClientConn {
}
conn, err := grpc.NewClient(*serverURI, opts...)
if err != nil {
errorLog.Fatalf("NewClient() failed: %v", err)
errorLog.Fatalf("Failed to create a client: %v", err)
}
return conn
}
Expand Down
2 changes: 1 addition & 1 deletion interop/http2/negative_http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func main() {
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(serverAddr, opts...)
if err != nil {
logger.Fatalf("NewClient() failed: %v", err)
logger.Fatalf("Failed to create a client: %v", err)
}
defer conn.Close()
tc := testgrpc.NewTestServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion interop/observability/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
}
conn, err := grpc.NewClient(serverAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("NewClient() failed: %v", err)
log.Fatalf("Failed to create a client: %v", err)
}
defer conn.Close()
tc := testgrpc.NewTestServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion interop/xds/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func main() {
for i := 0; i < *numChannels; i++ {
conn, err := grpc.NewClient(*server, grpc.WithTransportCredentials(creds))
if err != nil {
logger.Fatalf("NewClient() failed: %v", err)
logger.Fatalf("Failed to create a client: %v", err)
}
defer conn.Close()
clients[i] = testgrpc.NewTestServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion interop/xds_federation/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func main() {
}
cc, err := grpc.NewClient(uris[i], opts...)
if err != nil {
logger.Fatalf("NewClient() failed %v: %v", uris[i], err)
logger.Fatalf("Failed to create a client for server %q: %v", uris[i], err)
}
defer cc.Close()
clients = append(clients, clientConfig{
Expand Down
2 changes: 1 addition & 1 deletion profiling/cmd/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
}

logger.Infof("dialing %s", *flagAddress)
cc, err := grpc.NewClient(*flagAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))

Check warning on line 82 in profiling/cmd/remote.go

View check run for this annotation

Codecov / codecov/patch

profiling/cmd/remote.go#L82

Added line #L82 was not covered by tests
if err != nil {
logger.Errorf("NewClient() failed %s: %v", *flagAddress, err)
logger.Errorf("Failed to create a client for server %q: %v", *flagAddress, err)

Check warning on line 84 in profiling/cmd/remote.go

View check run for this annotation

Codecov / codecov/patch

profiling/cmd/remote.go#L84

Added line #L84 was not covered by tests
return err
}
defer cc.Close()
Expand Down
2 changes: 1 addition & 1 deletion resolver/manual/manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (r *Resolver) UpdateState(s resolver.State) {
defer r.mu.Unlock()
var err error
if r.CC == nil {
panic("cannot update state as grpc.NewClient with resolver has not been called")
panic("cannot update state as channel has not exited IDLE state")
}
err = r.CC.UpdateState(s)
r.lastSeenState = &s
Expand Down
2 changes: 1 addition & 1 deletion resolver/manual/manual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestResolver(t *testing.T) {

t.Run("update_state_panics", func(t *testing.T) {
defer func() {
want := "cannot update state as grpc.NewClient with resolver has not been called"
want := "cannot update state as channel has not exited IDLE state"
if r := recover(); r != want {
t.Errorf("expected panic %q, got %q", want, r)
}
Expand Down
Loading