Revert "fix: always attempt external auth refresh when fetching (#11762)"

This reverts commit 0befc0826a.
This commit is contained in:
Ammar Bandukwala
2024-01-25 14:22:47 -06:00
parent 0befc0826a
commit 79568bf628
6 changed files with 80 additions and 129 deletions

View File

@ -1577,7 +1577,7 @@ func TestWorkspaceAgentExternalAuthListen(t *testing.T) {
},
ExternalAuthConfigs: []*externalauth.Config{
fake.ExternalAuthConfig(t, providerID, nil, func(cfg *externalauth.Config) {
cfg.Type = codersdk.EnhancedExternalAuthProviderGitLab.String()
cfg.Type = codersdk.EnhancedExternalAuthProviderGitHub.String()
}),
},
})
@ -1623,8 +1623,7 @@ func TestWorkspaceAgentExternalAuthListen(t *testing.T) {
ticks <- time.Now()
}
cancel()
// We expect only 1. One from the initial "Refresh" attempt, and the
// other should be skipped.
// We expect only 1
// In a failed test, you will likely see 9, as the last one
// gets canceled.
require.Equal(t, 1, validateCalls, "validate calls duplicated on same token")