diff --git a/railgun/test/integration/controller_test.go b/railgun/test/integration/controller_test.go index f0487ad3..07ef8aa2 100644 --- a/railgun/test/integration/controller_test.go +++ b/railgun/test/integration/controller_test.go @@ -57,3 +57,20 @@ func TestMetricsEndpoint(t *testing.T) { return len(v) > 0 }, ingressWait, waitTick) } + +func TestProfilingEndpoint(t *testing.T) { + if useLegacyKIC() { + t.Skip("profiling endpoint behaves differently in legacy KIC") + } + _ = proxyReady() + assert.Eventually(t, func() bool { + profilingURL := fmt.Sprintf("http://localhost:%v/debug/pprof/", config.DiagnosticsPort) + resp, err := httpc.Get(profilingURL) + if err != nil { + t.Logf("WARNING: error while waiting for %s: %v", profilingURL, err) + return false + } + defer resp.Body.Close() + return resp.StatusCode == http.StatusOK + }, ingressWait, waitTick) +} diff --git a/railgun/test/integration/suite_test.go b/railgun/test/integration/suite_test.go index b8baa59a..63b8c501 100644 --- a/railgun/test/integration/suite_test.go +++ b/railgun/test/integration/suite_test.go @@ -234,6 +234,7 @@ func deployControllers(ctx context.Context, ready chan ktfkind.ProxyReadinessEve "--admission-webhook-listen=172.17.0.1:49023", fmt.Sprintf("--admission-webhook-cert=%s", admissionWebhookCert), fmt.Sprintf("--admission-webhook-key=%s", admissionWebhookKey), + "--profiling", }) fmt.Fprintf(os.Stderr, "config: %+v\n", config)