Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2020-03-27 13:40:12 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2020-03-27 13:40:12 +0300
commit021adce4fff183aa62441fd4e155e376a1cd8e78 (patch)
tree90e05c3fbbff091a918a7404a043c72b429b61a5
parent68ba5c768ba8374be11cff13c0815d4eb3bd4571 (diff)
Fix gitlab source cache tests duration
This reduces tests duration from 30sec to milliseconds.
-rw-r--r--internal/source/gitlab/cache/cache_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/source/gitlab/cache/cache_test.go b/internal/source/gitlab/cache/cache_test.go
index c3e03dec..97f0c339 100644
--- a/internal/source/gitlab/cache/cache_test.go
+++ b/internal/source/gitlab/cache/cache_test.go
@@ -233,14 +233,14 @@ func TestResolve(t *testing.T) {
})
t.Run("when retrieval failed because of an external context being canceled", func(t *testing.T) {
- ctx, cancel := context.WithCancel(context.Background())
- cancel()
+ cc := defaultCacheConfig
+ cc.retrievalTimeout = 0
- withTestCache(resolverConfig{}, nil, func(cache *Cache, resolver *client) {
- lookup := cache.Resolve(ctx, "my.gitlab.com")
+ withTestCache(resolverConfig{}, &cc, func(cache *Cache, resolver *client) {
+ lookup := cache.Resolve(context.Background(), "my.gitlab.com")
require.Equal(t, uint64(0), resolver.stats.getLookups())
- require.EqualError(t, lookup.Error, "context done")
+ require.EqualError(t, lookup.Error, "retrieval context done")
})
})