From fec80113c7ceccfdc5dd8494cc0d1afb163af5c2 Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Wed, 16 Dec 2020 08:26:44 -0500 Subject: [PATCH] Revert "Retry a couple of times if we fail to get a token from the Supervisor" This reverts commit be4e34d0c06cc7c8a27014c76e62e147e723eaf5. Roll back this change that was supposed to make the test more robust. If we retry multiple token exchanges with the same auth code, of course we are going to get failures on the second try onwards because the auth code was invalidated on the first try. Signed-off-by: Andrew Keesler --- test/integration/supervisor_login_test.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/integration/supervisor_login_test.go b/test/integration/supervisor_login_test.go index 10b50acd..ed4ca1eb 100644 --- a/test/integration/supervisor_login_test.go +++ b/test/integration/supervisor_login_test.go @@ -165,15 +165,8 @@ func TestSupervisorLogin(t *testing.T) { authcode := callback.URL.Query().Get("code") require.NotEmpty(t, authcode) - // Call the token endpoint to get tokens. Give the Supervisor a couple of seconds to wire up its signing key. - var tokenResponse *oauth2.Token - assert.Eventually(t, func() bool { - tokenResponse, err = downstreamOAuth2Config.Exchange(oidcHTTPClientContext, authcode, pkceParam.Verifier()) - if err != nil { - t.Logf("error trying to exchange auth code (%s), trying again", err.Error()) - } - return err == nil - }, time.Second*5, time.Second*1) + // Call the token endpoint to get tokens. + tokenResponse, err := downstreamOAuth2Config.Exchange(oidcHTTPClientContext, authcode, pkceParam.Verifier()) require.NoError(t, err) expectedIDTokenClaims := []string{"iss", "exp", "sub", "aud", "auth_time", "iat", "jti", "nonce", "rat"}