(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func 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 | |
| 46 | func TestNewPprofServerWithDevelopment(t *testing.T) { |
| 47 | setupLog := ctrl.Log.WithName("test") |
nothing calls this directly
no test coverage detected