You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: grpcecho_test.go
    path of file: ./repos/istio/pilot/pkg/networking/grpcgen
    
    the code of the file until where you have to start completion: // Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the
    
func newConfigGenTest(t *testing.T, discoveryOpts xds.FakeOptions, servers ...echoCfg) *configGenTest {
	if runtime.GOOS == "darwin" && len(servers) > 1 {
		// TODO always skip if this breaks anywhere else
		t.Skip("cannot use 127.0.0.2-255 on OSX without manual setup")
	}

	cgt := &configGenTest{T: t}
	wg := sync.WaitGroup{}
	var cfgs []config.Config

	discoveryOpts.ListenerBuilder = func() (net.Listener, error) {
		return net.Listen("tcp", "127.0.0.1:0")
	}
	// Start XDS server
	cgt.ds = xds.NewFakeDiscoveryServer(t, discoveryOpts)
	_, xdsPorts, _ := net.SplitHostPort(cgt.ds.Listener.Addr().String())
	xdsPort, _ := strconv.Atoi(xdsPorts)
	cgt.xdsPort = xdsPort
	for i, s := range servers {
		if s.namespace == "" {
			s.namespace = "default"
		}
		// TODO this breaks without extra ifonfig aliases on OSX, and probably elsewhere
		ip := fmt.Sprintf("127.0.0.%d", i+1)

		ep, err := endpoint.New(endpoint.Config{
			Port: &common.Port{
				Name:             "grpc",
				Port:             0,
				Protocol:         protocol.GRPC,
				XDSServer:        true,
				XDSReadinessTLS:  s.tls,
				XDSTestBootstrap: GRPCBootstrap("echo-"+s.version, s.namespace, ip, xdsPort),
			},
			ListenerIP: ip,
			Version:    s.version,
		})
		if err != nil {
			t.Fatal(err)
		}
		wg.Add(1)
		if err := ep.Start(func() {
			wg.Done()
		}); err != nil {
			t.Fatal(err)
		}

		cfgs = append(cfgs, makeWE(s, ip, ep.GetConfig().Port.Port))
		cgt.endpoints = append(cgt.endpoints, ep)
		t.Cleanup(func() {
			if err := ep.Close(); err != nil {
				t.Errorf("failed to close endpoint %s: %v", ip, err)
			}
		})
	}
	for _, cfg := range cfgs {
		if _, err := cgt.ds.Env().Create(cfg); err != nil {
			t.Fatalf("failed to create config %v: %v", cfg.Name, err)
		}
	}
	// we know onReady will get called because there are internal timeouts for this
	wg.Wait()
	return cgt
}