MCPcopy
hub / github.com/AdguardTeam/dnsproxy / TestCache_concurrent

Function TestCache_concurrent

proxy/cache_internal_test.go:275–295  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

273}
274
275func 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
297const (
298 // cacheTick is a cache check period.

Callers

nothing calls this directly

Calls 2

newTestCacheFunction · 0.85
setAndGetCacheFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…