Skip to content

Commit

Permalink
fix: Do not DNS resolve on TestJoinServiceClient_RegisterUsingTPMMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
codingllama authored and github-actions committed Jun 5, 2024
1 parent 7cf6755 commit 7f2e4d8
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 7f2e4d8

Please sign in to comment.