MCPcopy
hub / github.com/cortexlabs/cortex / TestDefaultProbeFailure

Function TestDefaultProbeFailure

pkg/probe/probe_test.go:73–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestDefaultProbeFailure(t *testing.T) {
74 t.Parallel()
75
76 log := newLogger(t)
77 defer func() { _ = log.Sync() }()
78
79 target := "http://127.0.0.1:12345"
80 pb := probe.NewDefaultProbe(target, log)
81
82 stopper := pb.StartProbing()
83 defer func() {
84 stopper <- struct{}{}
85 }()
86
87 for {
88 if pb.HasRunOnce() {
89 break
90 }
91 time.Sleep(time.Second)
92 }
93
94 require.False(t, pb.IsHealthy())
95}
96
97func TestProbeHTTPFailure(t *testing.T) {
98 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewDefaultProbeFunction · 0.92
StartProbingMethod · 0.80
HasRunOnceMethod · 0.80
IsHealthyMethod · 0.80
newLoggerFunction · 0.70

Tested by

no test coverage detected