From 6903196c181b05eb37f70d12baa5a5e85c7beb4d Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Wed, 2 Jun 2021 14:00:35 -0500 Subject: [PATCH] Fix a data race in TestImpersonationProxy. The `require.Eventually()` function runs the body of the check in a separate goroutine, so it's not safe to use other `require` assertions as we did here. Our `library.RequireEventuallyWithoutError()` function does not spawn a goroutine, so it's safer to use here. Signed-off-by: Matt Moyer --- test/integration/concierge_impersonation_proxy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/concierge_impersonation_proxy_test.go b/test/integration/concierge_impersonation_proxy_test.go index 688ccb80a..98b44dcff 100644 --- a/test/integration/concierge_impersonation_proxy_test.go +++ b/test/integration/concierge_impersonation_proxy_test.go @@ -1267,9 +1267,9 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl }) // wait until the credential issuer is updated with the new url - require.Eventually(t, func() bool { + library.RequireEventuallyWithoutError(t, func() (bool, error) { newImpersonationProxyURL, _ := performImpersonatorDiscovery(ctx, t, env, adminConciergeClient) - return newImpersonationProxyURL == "https://"+clusterIPServiceURL + return newImpersonationProxyURL == "https://"+clusterIPServiceURL, nil }, 30*time.Second, 500*time.Millisecond) newImpersonationProxyURL, newImpersonationProxyCACertPEM := performImpersonatorDiscovery(ctx, t, env, adminConciergeClient)