Skip to content

Commit

Permalink
fix: Do not DNS resolve on TestJoinServiceClient_RegisterUsingTPMMeth…
Browse files Browse the repository at this point in the history
…od (#42513)
  • Loading branch information
codingllama authored Jun 5, 2024
1 parent 282f6f0 commit 93f8f92
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/client/joinservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,14 @@ func TestJoinServiceClient_RegisterUsingTPMMethod(t *testing.T) {
cancel()
}()

c, err := grpc.NewClient("unused.com", grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) {
return lis.DialContext(ctx)
}), grpc.WithTransportCredentials(insecure.NewCredentials()))
// grpc.NewClient attempts to DNS resolve addr, whereas grpc.Dial doesn't.
c, err := grpc.Dial(
"bufconn",
grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) {
return lis.DialContext(ctx)
}),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
require.NoError(t, err)

joinClient := NewJoinServiceClient(proto.NewJoinServiceClient(c))
Expand Down

0 comments on commit 93f8f92

Please sign in to comment.