(t *testing.T, addr string, wg *sync.WaitGroup)
| 148 | } |
| 149 | |
| 150 | func 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…