MCPcopy Index your code
hub / github.com/golang/groupcache / awaitAddrReady

Function awaitAddrReady

http_test.go:150–167  ·  view source on GitHub ↗
(t *testing.T, addr string, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

148}
149
150func awaitAddrReady(t *testing.T, addr string, wg *sync.WaitGroup) {
151 defer wg.Done()
152 const max = 1 * time.Second
153 tries := 0
154 for {
155 tries++
156 c, err := net.Dial("tcp", addr)
157 if err == nil {
158 c.Close()
159 return
160 }
161 delay := time.Duration(tries) * 25 * time.Millisecond
162 if delay > max {
163 delay = max
164 }
165 time.Sleep(delay)
166 }
167}

Callers 1

TestHTTPPoolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…