(t *testing.T)
| 273 | } |
| 274 | |
| 275 | func TestCache_concurrent(t *testing.T) { |
| 276 | testCache := newTestCache(t, nil) |
| 277 | |
| 278 | hosts := map[string]string{ |
| 279 | dns.Fqdn("yandex.com"): "213.180.204.62", |
| 280 | dns.Fqdn("google.com"): "8.8.8.8", |
| 281 | dns.Fqdn("www.google.com"): "8.8.4.4", |
| 282 | dns.Fqdn("youtube.com"): "173.194.221.198", |
| 283 | dns.Fqdn("car.ru"): "37.220.161.35", |
| 284 | dns.Fqdn("cat.ru"): "192.56.231.67", |
| 285 | } |
| 286 | |
| 287 | g := &sync.WaitGroup{} |
| 288 | g.Add(len(hosts)) |
| 289 | |
| 290 | for k, v := range hosts { |
| 291 | go setAndGetCache(t, testCache, g, k, v) |
| 292 | } |
| 293 | |
| 294 | g.Wait() |
| 295 | } |
| 296 | |
| 297 | const ( |
| 298 | // cacheTick is a cache check period. |
nothing calls this directly
no test coverage detected
searching dependent graphs…