Closed raserva closed 2 years ago
we manually create servers all over for testing like so:
lis, err := net.Listen("tcp", "localhost:0") if err != nil { t.Fatal(err) } // not checked, but makes linter happy errs := make(chan error, 1) go func() { errs <- serv.Serve(lis) close(errs) }() conn, err := grpc.Dial(lis.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal(err) } clientOpt = option.WithGRPCConn(conn) t.Cleanup(func() { conn.Close() })
Instead we should use testutil. https://github.com/abcxyz/pkg/blob/main/testutil/grpc.go
Verified that testutil https://github.com/abcxyz/pkg/blob/main/testutil/grpc.go has been used across JVS code repo
we manually create servers all over for testing like so:
Instead we should use testutil. https://github.com/abcxyz/pkg/blob/main/testutil/grpc.go