Skip to content

Commit a709695

Browse files
committed
TEST TMP: describe metrics pod on failure
Signed-off-by: Todd Short <[email protected]>
1 parent ae0b775 commit a709695

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/e2e/metrics_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,15 @@ func (c *MetricsTestConfig) validate(t *testing.T, token string) {
159159
t.Log("Waiting for the curl pod to be ready")
160160
waitCmd := exec.Command(c.client, "wait", "--for=condition=Ready", "pod", c.curlPodName, "--namespace", c.namespace, "--timeout=60s")
161161
waitOutput, waitErr := waitCmd.CombinedOutput()
162-
require.NoError(t, waitErr, "Error waiting for curl pod to be ready: %s", string(waitOutput))
162+
if waitErr != nil {
163+
output, err := exec.Command(c.client, "describe", "pod", c.curlPodName, "--namespace", c.namespace).CombinedOutput()
164+
if err == nil {
165+
t.Logf("describe pod %s -n %s: %s", c.curlPodName, c.namespace, output)
166+
} else {
167+
require.NoError(t, err, "Error describing curl pod: %s", string(output))
168+
}
169+
require.NoError(t, waitErr, "Error waiting for curl pod to be ready: %s", string(waitOutput))
170+
}
163171

164172
t.Log("Validating the metrics endpoint")
165173
curlCmd := exec.Command(c.client, "exec", c.curlPodName, "--namespace", c.namespace, "--",

0 commit comments

Comments
 (0)