MCPcopy
hub / github.com/grpc/grpc-go / checkCacheCC

Function checkCacheCC

balancer/grpclb/grpclb_util_test.go:78–88  ·  view source on GitHub ↗
(ccc *lbCacheClientConn, sccLen, sctaLen int)

Source from the content-addressed store, hash-verified

76}
77
78func checkCacheCC(ccc *lbCacheClientConn, sccLen, sctaLen int) error {
79 ccc.mu.Lock()
80 defer ccc.mu.Unlock()
81 if len(ccc.subConnCache) != sccLen {
82 return fmt.Errorf("ccc = %+v, want len(ccc.subConnCache) = %v", ccc.subConnCache, sccLen)
83 }
84 if len(ccc.subConnToAddr) != sctaLen {
85 return fmt.Errorf("ccc = %+v, want len(ccc.subConnToAddr) = %v", ccc.subConnToAddr, sctaLen)
86 }
87 return nil
88}
89
90// Test that SubConn won't be immediately shut down.
91func (s) TestLBCacheClientConnExpire(t *testing.T) {

Calls 3

ErrorfMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected