From ebd5e45fa60a8b7ce73bad03cd955c380686693b Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Fri, 19 Mar 2021 12:54:37 -0400 Subject: [PATCH] test/integration: wait for convergence at end of impersonation test Signed-off-by: Andrew Keesler --- test/integration/concierge_impersonation_proxy_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/integration/concierge_impersonation_proxy_test.go b/test/integration/concierge_impersonation_proxy_test.go index 6593080c..3e0002a3 100644 --- a/test/integration/concierge_impersonation_proxy_test.go +++ b/test/integration/concierge_impersonation_proxy_test.go @@ -156,7 +156,7 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl } // At the end of the test, clean up the ConfigMap. t.Cleanup(func() { - ctx, cancel = context.WithTimeout(context.Background(), time.Minute) + ctx, cancel = context.WithTimeout(context.Background(), 2*time.Minute) defer cancel() // Delete any version that was created by this test. @@ -175,6 +175,14 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl _, err = adminClient.CoreV1().ConfigMaps(env.ConciergeNamespace).Create(ctx, oldConfigMap, metav1.CreateOptions{}) require.NoError(t, err) } + + // If we are running on an environment that has a load balancer, expect that the + // CredentialIssuer will be updated eventually with a successful impersonation proxy frontend. + // We do this to ensure that future tests that use the impersonation proxy (e.g., + // TestE2EFullIntegration) will start with a known-good state. + if env.HasCapability(library.HasExternalLoadBalancerProvider) { + performImpersonatorDiscovery(ctx, t, env, adminConciergeClient) + } }) if env.HasCapability(library.HasExternalLoadBalancerProvider) { //nolint:nestif // come on... it's just a test