Merge pull request #535 from mattmoyer/deflake-impersonation-proxy-test-dns

Deflake TestImpersonationProxy (especially on EKS).
This commit is contained in:
Matt Moyer 2021-03-30 12:31:44 -07:00 committed by GitHub
commit 210114dbe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,8 +133,14 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
// so it more closely simulates the normal use case, and also because we want this to work on AKS clusters // so it more closely simulates the normal use case, and also because we want this to work on AKS clusters
// which do not allow anonymous requests. // which do not allow anonymous requests.
client := newAnonymousImpersonationProxyClient(impersonationProxyURL, impersonationProxyCACertPEM, "").PinnipedConcierge client := newAnonymousImpersonationProxyClient(impersonationProxyURL, impersonationProxyCACertPEM, "").PinnipedConcierge
mostRecentTokenCredentialRequestResponse, err = createTokenCredentialRequest(credentialRequestSpecWithWorkingCredentials, client) require.Eventually(t, func() bool {
require.NoError(t, err, library.Sdump(err)) mostRecentTokenCredentialRequestResponse, err = createTokenCredentialRequest(credentialRequestSpecWithWorkingCredentials, client)
if err != nil {
t.Logf("failed to make TokenCredentialRequest: %s", library.Sdump(err))
return false
}
return true
}, 5*time.Minute, 5*time.Second)
require.Nil(t, mostRecentTokenCredentialRequestResponse.Status.Message, require.Nil(t, mostRecentTokenCredentialRequestResponse.Status.Message,
"expected no error message but got: %s", library.Sdump(mostRecentTokenCredentialRequestResponse.Status.Message)) "expected no error message but got: %s", library.Sdump(mostRecentTokenCredentialRequestResponse.Status.Message))