Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Jul 16, 2024
1 parent 56d7f2f commit 47c279f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions static/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/resolver"
)

const anyLocalhost = "127.0.0.1:0"
Expand Down Expand Up @@ -52,6 +53,10 @@ func TestServer_InMemory(t *testing.T) {
_ = resp.Body.Close()

// Validate gRPC
//
// Change the default scheme so that the custom dialer works:
// https://github.com/grpc/grpc-go/blob/700ca74d015d3b75431cc2b343fa1ba1ceb1b7f3/clientconn.go#L214-L218
resolver.SetDefaultScheme("passthrough")
grpcDialer := grpc.WithContextDialer(func(ctx context.Context, s string) (net.Conn, error) {
return srv.DialContext(ctx, "", s)
})
Expand Down

0 comments on commit 47c279f

Please sign in to comment.