MCPcopy
hub / github.com/fluid-cloudnative/fluid / TestNewPprofServer

Function TestNewPprofServer

pkg/utils/pprof_test.go:27–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestNewPprofServer(t *testing.T) {
28 setupLog := ctrl.Log.WithName("test")
29 pprofAddr := "127.0.0.1:6060"
30 NewPprofServer(setupLog, pprofAddr, false)
31 paths := []string{
32 "/debug/pprof/", "/debug/pprof/cmdline", "/debug/pprof/profile", "/debug/pprof/symbol", "/debug/pprof/trace",
33 }
34 time.Sleep(10 * time.Second)
35 for _, p := range paths {
36 resp, err := http.Get("http://127.0.0.1:6060" + p)
37 if err != nil {
38 t.Error(err)
39 }
40 if resp.StatusCode != http.StatusOK {
41 t.Errorf("status code is %d", resp.StatusCode)
42 }
43 }
44}
45
46func TestNewPprofServerWithDevelopment(t *testing.T) {
47 setupLog := ctrl.Log.WithName("test")

Callers

nothing calls this directly

Calls 2

NewPprofServerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected