From 5b1dc0abdfd9e99261dd70d04f36b1f2a49b1f45 Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Fri, 12 Mar 2021 10:45:36 -0500 Subject: [PATCH] test/integration: add some more debugging to kubectl impersonation test I think this is nondeterministic... Signed-off-by: Andrew Keesler --- test/integration/concierge_impersonation_proxy_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/concierge_impersonation_proxy_test.go b/test/integration/concierge_impersonation_proxy_test.go index 327e8a9a..76a8cd7d 100644 --- a/test/integration/concierge_impersonation_proxy_test.go +++ b/test/integration/concierge_impersonation_proxy_test.go @@ -597,14 +597,14 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl // run the kubectl port-forward command timeout, cancelFunc := context.WithTimeout(ctx, 2*time.Minute) defer cancelFunc() - portForwardCmd, _, stderr := kubectlCommand(timeout, "port-forward", "--namespace", env.ConciergeNamespace, conciergePod.Name, "8443:8443") + portForwardCmd, portForwardStdout, portForwardStderr := kubectlCommand(timeout, "port-forward", "--namespace", env.ConciergeNamespace, conciergePod.Name, "8443:8443") portForwardCmd.Env = envVarsWithProxy // start, but don't wait for the command to finish err = portForwardCmd.Start() require.NoError(t, err, `"kubectl port-forward" failed`) go func() { - assert.EqualErrorf(t, portForwardCmd.Wait(), "signal: killed", `wanted "kubectl port-forward" to get signaled because context was cancelled (stderr: %q)`, stderr.String()) + assert.EqualErrorf(t, portForwardCmd.Wait(), "signal: killed", `wanted "kubectl port-forward" to get signaled because context was cancelled (stderr: %q)`, portForwardStderr.String()) }() // then run curl something against it @@ -622,7 +622,7 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl t.Log("stdout: " + curlStdOut.String()) } // we expect this to 403, but all we care is that it gets through - require.Contains(t, curlStdOut.String(), "\"forbidden: User \\\"system:anonymous\\\" cannot get path \\\"/\\\"\"") + require.Containsf(t, curlStdOut.String(), "\"forbidden: User \\\"system:anonymous\\\" cannot get path \\\"/\\\"\"", "unexpected curl response\nport-forward stdout:\n%q\nport-forward stderr:\n%q", portForwardStdout.String(), portForwardStderr.String()) // run the kubectl attach command namespaceName := createTestNamespace(t, adminClient)