From 4b035b358eaa93f67eaeaf83ab57ec12ec2cdc90 Mon Sep 17 00:00:00 2001 From: Gavin Frazar Date: Fri, 19 May 2023 18:58:51 -0700 Subject: [PATCH] fix TestALPNProxyHTTPProxyBasicAuthDial flakiness * stop the node before resetting http proxy auth credentials, then start the node again which succeeds immediately, so that the test doesn't time out after 10 seconds waiting for the node to join due to random backoff/jitter. --- integration/proxy/proxy_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/integration/proxy/proxy_test.go b/integration/proxy/proxy_test.go index 700482f3594eb..2594a530b9306 100644 --- a/integration/proxy/proxy_test.go +++ b/integration/proxy/proxy_test.go @@ -1170,11 +1170,18 @@ func TestALPNProxyHTTPProxyBasicAuthDial(t *testing.T) { }() require.ErrorIs(t, authorizer.WaitForRequest(timeout), trace.AccessDenied("bad credentials")) require.Zero(t, ph.Count()) + // stop the node so it doesn't keep trying to join the cluster with bad credentials. + require.NoError(t, rc.StopNodes()) + require.Error(t, <-startErrC) // set the auth credentials to match our environment authorizer.SetCredentials(user, pass) - // with env set correctly and authorized, the node should register. + // with env set correctly and authorized, the node should be able to register. + go func() { + _, err := rc.StartNode(nodeCfg) + startErrC <- err + }() require.NoError(t, <-startErrC) require.NoError(t, helpers.WaitForNodeCount(context.Background(), rc, rc.Secrets.SiteName, 1)) require.Greater(t, ph.Count(), 0)