MCPcopy
hub / github.com/coredns/coredns / BenchmarkController

Function BenchmarkController

plugin/kubernetes/controller_test.go:58–75  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

56}
57
58func BenchmarkController(b *testing.B) {
59 ctx := context.Background()
60 k := kubernetesWithFakeClient(ctx, "10.0.0.0/24", true, "all")
61
62 go k.APIConn.Run()
63 defer k.APIConn.Stop()
64 for !k.APIConn.HasSynced() {
65 time.Sleep(time.Millisecond)
66 }
67
68 rw := &test.ResponseWriter{}
69 m := new(dns.Msg)
70 m.SetQuestion("svc1.testns.svc.cluster.local.", dns.TypeA)
71
72 for b.Loop() {
73 k.ServeDNS(ctx, rw, m)
74 }
75}
76
77func TestEndpointsDisabled(t *testing.T) {
78 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

kubernetesWithFakeClientFunction · 0.85
RunMethod · 0.65
StopMethod · 0.65
HasSyncedMethod · 0.65
ServeDNSMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…