func (tcc *TestClientConn) NewSubConn(a []resolver.Address, o balancer.NewSubConnOptions) (balancer.SubConn, error) {
	sc := TestSubConns[tcc.subConnIdx]
	tcc.subConnIdx++
	tcc.logger.Logf("testClientConn: NewSubConn(%v, %+v) => %s", a, o, sc)
	select {
	case tcc.NewSubConnAddrsCh <- a:
	default:
	}
	select {
	case tcc.NewSubConnCh <- sc:
	default:
	}
	return sc, nil
}
NewSubConn creates a new SubConn.
package testutils
import (
	"context"
	"errors"
	"fmt"
	"testing"
	"google.golang.org/grpc/balancer"
	"google.golang.org/grpc/connectivity"
	"google.golang.org/grpc/resolver"
)
const TestSubConnsCount = 16
type testingLogger interface {
	Log(args ...interface{})
	Logf(format string, args ...interface{})
}
var TestSubConns []*TestSubConn
func init() {
	for i := 0; i < TestSubConnsCount; i++ {
		TestSubConns = append(TestSubConns, &TestSubConn{
			id:        fmt.Sprintf("sc%d", i),
			ConnectCh: make(chan struct{}, 1),
		})
	}
}
type TestSubConn struct {
	id        string
	ConnectCh chan struct{}
}
func (tsc *TestSubConn) UpdateAddresses([]resolver.Address) {}
func (tsc *TestSubConn) Connect() {
	select {
	case tsc.ConnectCh <- struct{}{}:
	default:
	}
}
func (tsc *TestSubConn) String() string {
	return tsc.id
}
type TestClientConn struct {
	logger testingLogger
	NewSubConnAddrsCh      chan []resolver.Address  
	NewSubConnCh           chan balancer.SubConn    
	RemoveSubConnCh        chan balancer.SubConn    
	UpdateAddressesAddrsCh chan []resolver.Address  
	NewPickerCh  chan balancer.Picker             
	NewStateCh   chan connectivity.State          
	ResolveNowCh chan resolver.ResolveNowOptions  
	subConnIdx int
}
func NewTestClientConn(t *testing.T) *TestClientConn {
	return &TestClientConn{
		logger: t,
		NewSubConnAddrsCh:      make(chan []resolver.Address, 10),
		NewSubConnCh:           make(chan balancer.SubConn, 10),
		RemoveSubConnCh:        make(chan balancer.SubConn, 10),
		UpdateAddressesAddrsCh: make(chan []resolver.Address, 1),
		NewPickerCh:  make(chan balancer.Picker, 1),
		NewStateCh:   make(chan connectivity.State, 1),
		ResolveNowCh: make(chan resolver.ResolveNowOptions, 1),
	}
}