X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/39c17737ac69d7693684fe2f95bef0ec235a28bf..d08871688722c5303b56e5a76456aec7d10e770b:/services/keep-web/cache_test.go diff --git a/services/keep-web/cache_test.go b/services/keep-web/cache_test.go index d147573eec..1f1f6b3bd9 100644 --- a/services/keep-web/cache_test.go +++ b/services/keep-web/cache_test.go @@ -33,7 +33,7 @@ func (s *UnitSuite) TestCache(c *check.C) { arv, err := arvadosclient.MakeArvadosClient() c.Assert(err, check.Equals, nil) - cache := DefaultConfig().Cache + cache := newConfig(s.Config).Cache cache.registry = prometheus.NewRegistry() // Hit the same collection 5 times using the same token. Only @@ -45,7 +45,7 @@ func (s *UnitSuite) TestCache(c *check.C) { coll, err = cache.Get(arv, arvadostest.FooCollection, false) c.Check(err, check.Equals, nil) c.Assert(coll, check.NotNil) - c.Check(coll.PortableDataHash, check.Equals, arvadostest.FooPdh) + c.Check(coll.PortableDataHash, check.Equals, arvadostest.FooCollectionPDH) c.Check(coll.ManifestText[:2], check.Equals, ". ") } s.checkCacheMetrics(c, cache.registry, @@ -62,10 +62,10 @@ func (s *UnitSuite) TestCache(c *check.C) { // lookup. arv.ApiToken = arvadostest.ActiveToken - coll2, err := cache.Get(arv, arvadostest.FooPdh, false) + coll2, err := cache.Get(arv, arvadostest.FooCollectionPDH, false) c.Check(err, check.Equals, nil) c.Assert(coll2, check.NotNil) - c.Check(coll2.PortableDataHash, check.Equals, arvadostest.FooPdh) + c.Check(coll2.PortableDataHash, check.Equals, arvadostest.FooCollectionPDH) c.Check(coll2.ManifestText[:2], check.Equals, ". ") c.Check(coll2.ManifestText, check.Not(check.Equals), coll.ManifestText) @@ -76,10 +76,10 @@ func (s *UnitSuite) TestCache(c *check.C) { "pdh_hits 4", "api_calls 2") - coll2, err = cache.Get(arv, arvadostest.FooPdh, false) + coll2, err = cache.Get(arv, arvadostest.FooCollectionPDH, false) c.Check(err, check.Equals, nil) c.Assert(coll2, check.NotNil) - c.Check(coll2.PortableDataHash, check.Equals, arvadostest.FooPdh) + c.Check(coll2.PortableDataHash, check.Equals, arvadostest.FooCollectionPDH) c.Check(coll2.ManifestText[:2], check.Equals, ". ") s.checkCacheMetrics(c, cache.registry, @@ -114,11 +114,11 @@ func (s *UnitSuite) TestCacheForceReloadByPDH(c *check.C) { arv, err := arvadosclient.MakeArvadosClient() c.Assert(err, check.Equals, nil) - cache := DefaultConfig().Cache + cache := newConfig(s.Config).Cache cache.registry = prometheus.NewRegistry() for _, forceReload := range []bool{false, true, false, true} { - _, err := cache.Get(arv, arvadostest.FooPdh, forceReload) + _, err := cache.Get(arv, arvadostest.FooCollectionPDH, forceReload) c.Check(err, check.Equals, nil) } @@ -134,7 +134,7 @@ func (s *UnitSuite) TestCacheForceReloadByUUID(c *check.C) { arv, err := arvadosclient.MakeArvadosClient() c.Assert(err, check.Equals, nil) - cache := DefaultConfig().Cache + cache := newConfig(s.Config).Cache cache.registry = prometheus.NewRegistry() for _, forceReload := range []bool{false, true, false, true} {