diff options
-rw-r--r-- | internal/source/gitlab/cache/entry.go | 5 | ||||
-rw-r--r-- | internal/source/gitlab/cache/entry_test.go | 28 |
2 files changed, 0 insertions, 33 deletions
diff --git a/internal/source/gitlab/cache/entry.go b/internal/source/gitlab/cache/entry.go index 1c752913..ae06a215 100644 --- a/internal/source/gitlab/cache/entry.go +++ b/internal/source/gitlab/cache/entry.go @@ -4,7 +4,6 @@ import ( "context" "errors" "net" - "os" "sync" "time" @@ -113,10 +112,6 @@ func (e *Entry) timedOut() bool { // and is different to domain.ErrDomainDoesNotExist (this is an edge case to prevent serving // a page right after being deleted). func (e *Entry) hasTemporaryError() bool { - if os.Getenv("FF_DISABLE_REFRESH_TEMPORARY_ERROR") == "true" { - return false - } - return e.response != nil && e.response.Error != nil && e.domainExists() diff --git a/internal/source/gitlab/cache/entry_test.go b/internal/source/gitlab/cache/entry_test.go index d50822ce..2ba26fd2 100644 --- a/internal/source/gitlab/cache/entry_test.go +++ b/internal/source/gitlab/cache/entry_test.go @@ -4,7 +4,6 @@ import ( "context" "errors" "net/http" - "os" "testing" "time" @@ -119,33 +118,6 @@ func TestEntryRefresh(t *testing.T) { require.Equal(t, storedEntry.Lookup(), entry.Lookup(), "lookup should be the same") }) - t.Run("entry is the different when FF_DISABLE_REFRESH_TEMPORARY_ERROR is set to true", func(t *testing.T) { - client.failed = false - err := os.Setenv("FF_DISABLE_REFRESH_TEMPORARY_ERROR", "true") - - entry := newCacheEntry("test.gitlab.io", cc.EntryRefreshTimeout, cc.CacheExpiry) - - ctx, cancel := context.WithTimeout(context.Background(), cc.RetrievalTimeout) - defer cancel() - - lookup := cache.retrieve(ctx, entry) - require.NoError(t, lookup.Error) - - require.Eventually(t, entry.NeedsRefresh, 100*time.Millisecond, time.Millisecond, "entry should need refresh") - - require.NoError(t, err) - - cache.refreshFunc(entry) - - require.True(t, client.failed, "refresh should have failed") - - storedEntry := loadEntry(t, "test.gitlab.io", cache.store) - - require.Error(t, storedEntry.Lookup().Error, "resolving failed") - require.True(t, storedEntry.refreshedOriginalTimestamp.IsZero()) - require.NotEqual(t, storedEntry.Lookup(), entry.Lookup(), "lookup should be different") - }) - t.Run("entry is different after it expired and calling refresh on it", func(t *testing.T) { client.failed = false |