MCPcopy
hub / github.com/istio/istio / startAndWaitForServer

Function startAndWaitForServer

pkg/ctrlz/ctrlz_test.go:61–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

59}
60
61func startAndWaitForServer(t *testing.T) *Server {
62 ready := make(chan struct{}, 1)
63 listeningTestProbe = func() {
64 ready <- struct{}{}
65 }
66 defer func() { listeningTestProbe = nil }()
67
68 // Start and wait for server
69 o := DefaultOptions()
70 o.Port = 0
71 s, err := Run(o, nil)
72 if err != nil {
73 t.Fatalf("Failed to start server: %v", err)
74 }
75 select {
76 case <-ready:
77 case <-time.After(5 * time.Second):
78 t.Fatal("Timed out waiting for server start")
79 }
80 return s
81}

Callers 2

TestStartStopEnabledFunction · 0.85
TestSignalsFunction · 0.85

Calls 4

DefaultOptionsFunction · 0.70
RunFunction · 0.70
FatalfMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…