[ARVADOS] created: 2.1.0-1350-g02b35f748

Git user git at public.arvados.org
Wed Sep 15 20:30:50 UTC 2021


        at  02b35f7480e2792377e2ed23f740fff4b53badb9 (commit)


commit 02b35f7480e2792377e2ed23f740fff4b53badb9
Author: Tom Clegg <tom at curii.com>
Date:   Wed Sep 15 16:24:50 2021 -0400

    18051: Add debug logging for webdav cache.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go
index ee61d1344..d2c79326a 100644
--- a/services/keep-web/cache.go
+++ b/services/keep-web/cache.go
@@ -334,12 +334,15 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 	if pdh == "" {
 		// UUID->PDH mapping is not cached, might as well get
 		// the whole collection record and be done (below).
+		c.logger.Debugf("cache(%s): have no pdh", targetID)
 	} else if cached := c.lookupCollection(arv.ApiToken + "\000" + pdh); cached == nil {
 		// PDH->manifest is not cached, might as well get the
 		// whole collection record (below).
+		c.logger.Debugf("cache(%s): have pdh %s but manifest is not cached", targetID, pdh)
 	} else if !pdhRefresh {
 		// We looked up UUID->PDH very recently, and we still
 		// have the manifest for that PDH.
+		c.logger.Debugf("cache(%s): have pdh %s and refresh not needed", targetID, pdh)
 		return cached, nil
 	} else {
 		// Get current PDH for this UUID (and confirm we still
@@ -355,11 +358,13 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 		if current.PortableDataHash == pdh {
 			// PDH has not changed, cached manifest is
 			// correct.
-			return cached, err
+			c.logger.Debugf("cache(%s): verified cached pdh %s is still correct", targetID, pdh)
+			return cached, nil
 		}
 		if cached := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); cached != nil {
 			// PDH changed, and we already have the
 			// manifest for that new PDH.
+			c.logger.Debugf("cache(%s): cached pdh %s was stale, new pdh is %s and manifest is already in cache", targetID, pdh, current.PortableDataHash)
 			return cached, nil
 		}
 	}
@@ -372,6 +377,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 	if err != nil {
 		return nil, err
 	}
+	c.logger.Debugf("cache(%s): retrieved manifest, caching with pdh %s", targetID, retrieved.PortableDataHash)
 	exp := time.Now().Add(time.Duration(c.config.TTL))
 	if targetID != retrieved.PortableDataHash {
 		c.pdhs.Add(targetID, &cachedPDH{

commit e4752e29dd45110b70d408e5b648cba8357bb5ea
Author: Tom Clegg <tom at curii.com>
Date:   Wed Sep 15 15:45:40 2021 -0400

    18051: Add logging capability to webdav cache.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go
index 16fbd0788..ee61d1344 100644
--- a/services/keep-web/cache.go
+++ b/services/keep-web/cache.go
@@ -14,6 +14,7 @@ import (
 	"git.arvados.org/arvados.git/sdk/go/keepclient"
 	lru "github.com/hashicorp/golang-lru"
 	"github.com/prometheus/client_golang/prometheus"
+	"github.com/sirupsen/logrus"
 )
 
 const metricsUpdateInterval = time.Second / 10
@@ -21,6 +22,7 @@ const metricsUpdateInterval = time.Second / 10
 type cache struct {
 	cluster     *arvados.Cluster
 	config      *arvados.WebDAVCacheConfig // TODO: use cluster.Collections.WebDAV instead
+	logger      logrus.FieldLogger
 	registry    *prometheus.Registry
 	metrics     cacheMetrics
 	pdhs        *lru.TwoQueueCache
diff --git a/services/keep-web/cache_test.go b/services/keep-web/cache_test.go
index 80e00b02a..3e2faaff7 100644
--- a/services/keep-web/cache_test.go
+++ b/services/keep-web/cache_test.go
@@ -10,6 +10,7 @@ import (
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/arvadosclient"
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
+	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/common/expfmt"
 	"gopkg.in/check.v1"
@@ -33,7 +34,7 @@ func (s *UnitSuite) TestCache(c *check.C) {
 	arv, err := arvadosclient.MakeArvadosClient()
 	c.Assert(err, check.Equals, nil)
 
-	cache := newConfig(s.Config).Cache
+	cache := newConfig(ctxlog.TestLogger(c), s.Config).Cache
 	cache.registry = prometheus.NewRegistry()
 
 	// Hit the same collection 5 times using the same token. Only
@@ -110,7 +111,7 @@ func (s *UnitSuite) TestCacheForceReloadByPDH(c *check.C) {
 	arv, err := arvadosclient.MakeArvadosClient()
 	c.Assert(err, check.Equals, nil)
 
-	cache := newConfig(s.Config).Cache
+	cache := newConfig(ctxlog.TestLogger(c), s.Config).Cache
 	cache.registry = prometheus.NewRegistry()
 
 	for _, forceReload := range []bool{false, true, false, true} {
@@ -129,7 +130,7 @@ func (s *UnitSuite) TestCacheForceReloadByUUID(c *check.C) {
 	arv, err := arvadosclient.MakeArvadosClient()
 	c.Assert(err, check.Equals, nil)
 
-	cache := newConfig(s.Config).Cache
+	cache := newConfig(ctxlog.TestLogger(c), s.Config).Cache
 	cache.registry = prometheus.NewRegistry()
 
 	for _, forceReload := range []bool{false, true, false, true} {
diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go
index a74b85b98..55c122b0f 100644
--- a/services/keep-web/handler_test.go
+++ b/services/keep-web/handler_test.go
@@ -50,7 +50,7 @@ func (s *UnitSuite) SetUpTest(c *check.C) {
 }
 
 func (s *UnitSuite) TestCORSPreflight(c *check.C) {
-	h := handler{Config: newConfig(s.Config)}
+	h := handler{Config: newConfig(ctxlog.TestLogger(c), s.Config)}
 	u := mustParseURL("http://keep-web.example/c=" + arvadostest.FooCollection + "/foo")
 	req := &http.Request{
 		Method:     "OPTIONS",
@@ -109,7 +109,7 @@ func (s *UnitSuite) TestEmptyResponse(c *check.C) {
 			c.Assert(err, check.IsNil)
 		}
 
-		h := handler{Config: newConfig(s.Config)}
+		h := handler{Config: newConfig(ctxlog.TestLogger(c), s.Config)}
 		u := mustParseURL("http://" + arvadostest.FooCollection + ".keep-web.example/foo")
 		req := &http.Request{
 			Method:     "GET",
@@ -159,7 +159,7 @@ func (s *UnitSuite) TestInvalidUUID(c *check.C) {
 			RequestURI: u.RequestURI(),
 		}
 		resp := httptest.NewRecorder()
-		cfg := newConfig(s.Config)
+		cfg := newConfig(ctxlog.TestLogger(c), s.Config)
 		cfg.cluster.Users.AnonymousUserToken = arvadostest.AnonymousToken
 		h := handler{Config: cfg}
 		h.ServeHTTP(resp, req)
@@ -1241,7 +1241,7 @@ func (s *IntegrationSuite) checkUploadDownloadRequest(c *check.C, h *handler, re
 }
 
 func (s *IntegrationSuite) TestDownloadLoggingPermission(c *check.C) {
-	config := newConfig(s.ArvConfig)
+	config := newConfig(ctxlog.TestLogger(c), s.ArvConfig)
 	h := handler{Config: config}
 	u := mustParseURL("http://" + arvadostest.FooCollection + ".keep-web.example/foo")
 
@@ -1314,7 +1314,7 @@ func (s *IntegrationSuite) TestDownloadLoggingPermission(c *check.C) {
 }
 
 func (s *IntegrationSuite) TestUploadLoggingPermission(c *check.C) {
-	config := newConfig(s.ArvConfig)
+	config := newConfig(ctxlog.TestLogger(c), s.ArvConfig)
 	h := handler{Config: config}
 
 	for _, adminperm := range []bool{true, false} {
diff --git a/services/keep-web/main.go b/services/keep-web/main.go
index a62e0abb6..a9ac834a2 100644
--- a/services/keep-web/main.go
+++ b/services/keep-web/main.go
@@ -29,7 +29,7 @@ type Config struct {
 	cluster *arvados.Cluster
 }
 
-func newConfig(arvCfg *arvados.Config) *Config {
+func newConfig(logger logrus.FieldLogger, arvCfg *arvados.Config) *Config {
 	cfg := Config{}
 	var cls *arvados.Cluster
 	var err error
@@ -39,6 +39,7 @@ func newConfig(arvCfg *arvados.Config) *Config {
 	cfg.cluster = cls
 	cfg.Cache.config = &cfg.cluster.Collections.WebDAVCache
 	cfg.Cache.cluster = cls
+	cfg.Cache.logger = logger
 	return &cfg
 }
 
@@ -81,7 +82,7 @@ func configure(logger log.FieldLogger, args []string) *Config {
 	if err != nil {
 		log.Fatal(err)
 	}
-	cfg := newConfig(arvCfg)
+	cfg := newConfig(logger, arvCfg)
 
 	if *dumpConfig {
 		out, err := yaml.Marshal(cfg)
diff --git a/services/keep-web/server_test.go b/services/keep-web/server_test.go
index d59229520..54e9ddf37 100644
--- a/services/keep-web/server_test.go
+++ b/services/keep-web/server_test.go
@@ -433,7 +433,7 @@ func (s *IntegrationSuite) SetUpTest(c *check.C) {
 	ldr.Path = "-"
 	arvCfg, err := ldr.Load()
 	c.Check(err, check.IsNil)
-	cfg := newConfig(arvCfg)
+	cfg := newConfig(ctxlog.TestLogger(c), arvCfg)
 	c.Assert(err, check.IsNil)
 	cfg.Client = arvados.Client{
 		APIHost:  testAPIHost,
diff --git a/services/keep-web/status_test.go b/services/keep-web/status_test.go
index 1b6ad93de..f90f85cd9 100644
--- a/services/keep-web/status_test.go
+++ b/services/keep-web/status_test.go
@@ -11,11 +11,12 @@ import (
 	"net/url"
 
 	"git.arvados.org/arvados.git/sdk/go/arvadostest"
+	"git.arvados.org/arvados.git/sdk/go/ctxlog"
 	"gopkg.in/check.v1"
 )
 
 func (s *UnitSuite) TestStatus(c *check.C) {
-	h := handler{Config: newConfig(s.Config)}
+	h := handler{Config: newConfig(ctxlog.TestLogger(c), s.Config)}
 	u, _ := url.Parse("http://keep-web.example/status.json")
 	req := &http.Request{
 		Method:     "GET",

commit 38489133d0d3ba3797447272edea7f618cf352df
Author: Tom Clegg <tom at curii.com>
Date:   Wed Sep 15 03:21:45 2021 -0400

    18051: Fix premature ejection from WebDAV collection cache.
    
    Avoid multiple concurrent cache sweeps.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go
index a52af8048..16fbd0788 100644
--- a/services/keep-web/cache.go
+++ b/services/keep-web/cache.go
@@ -25,9 +25,11 @@ type cache struct {
 	metrics     cacheMetrics
 	pdhs        *lru.TwoQueueCache
 	collections *lru.TwoQueueCache
-	permissions *lru.TwoQueueCache
 	sessions    *lru.TwoQueueCache
 	setupOnce   sync.Once
+
+	chPruneSessions    chan struct{}
+	chPruneCollections chan struct{}
 }
 
 type cacheMetrics struct {
@@ -37,7 +39,6 @@ type cacheMetrics struct {
 	sessionEntries    prometheus.Gauge
 	collectionHits    prometheus.Counter
 	pdhHits           prometheus.Counter
-	permissionHits    prometheus.Counter
 	sessionHits       prometheus.Counter
 	sessionMisses     prometheus.Counter
 	apiCalls          prometheus.Counter
@@ -65,13 +66,6 @@ func (m *cacheMetrics) setup(reg *prometheus.Registry) {
 		Help:      "Number of uuid-to-pdh cache hits.",
 	})
 	reg.MustRegister(m.pdhHits)
-	m.permissionHits = prometheus.NewCounter(prometheus.CounterOpts{
-		Namespace: "arvados",
-		Subsystem: "keepweb_collectioncache",
-		Name:      "permission_hits",
-		Help:      "Number of targetID-to-permission cache hits.",
-	})
-	reg.MustRegister(m.permissionHits)
 	m.apiCalls = prometheus.NewCounter(prometheus.CounterOpts{
 		Namespace: "arvados",
 		Subsystem: "keepweb_collectioncache",
@@ -117,8 +111,9 @@ func (m *cacheMetrics) setup(reg *prometheus.Registry) {
 }
 
 type cachedPDH struct {
-	expire time.Time
-	pdh    string
+	expire  time.Time
+	refresh time.Time
+	pdh     string
 }
 
 type cachedCollection struct {
@@ -149,10 +144,6 @@ func (c *cache) setup() {
 	if err != nil {
 		panic(err)
 	}
-	c.permissions, err = lru.New2Q(c.config.MaxPermissionEntries)
-	if err != nil {
-		panic(err)
-	}
 	c.sessions, err = lru.New2Q(c.config.MaxSessions)
 	if err != nil {
 		panic(err)
@@ -168,6 +159,18 @@ func (c *cache) setup() {
 			c.updateGauges()
 		}
 	}()
+	c.chPruneCollections = make(chan struct{}, 1)
+	go func() {
+		for range c.chPruneCollections {
+			c.pruneCollections()
+		}
+	}()
+	c.chPruneSessions = make(chan struct{}, 1)
+	go func() {
+		for range c.chPruneSessions {
+			c.pruneSessions()
+		}
+	}()
 }
 
 func (c *cache) updateGauges() {
@@ -192,19 +195,25 @@ func (c *cache) Update(client *arvados.Client, coll arvados.Collection, fs arvad
 	}
 	coll.ManifestText = m
 	var updated arvados.Collection
-	defer c.pdhs.Remove(coll.UUID)
 	err = client.RequestAndDecode(&updated, "PATCH", "arvados/v1/collections/"+coll.UUID, nil, map[string]interface{}{
 		"collection": map[string]string{
 			"manifest_text": coll.ManifestText,
 		},
 	})
-	if err == nil {
-		c.collections.Add(client.AuthToken+"\000"+updated.PortableDataHash, &cachedCollection{
-			expire:     time.Now().Add(time.Duration(c.config.TTL)),
-			collection: &updated,
-		})
+	if err != nil {
+		c.pdhs.Remove(coll.UUID)
+		return err
 	}
-	return err
+	c.collections.Add(client.AuthToken+"\000"+updated.PortableDataHash, &cachedCollection{
+		expire:     time.Now().Add(time.Duration(c.config.TTL)),
+		collection: &updated,
+	})
+	c.pdhs.Add(coll.UUID, &cachedPDH{
+		expire:  time.Now().Add(time.Duration(c.config.TTL)),
+		refresh: time.Now().Add(time.Duration(c.config.UUIDTTL)),
+		pdh:     updated.PortableDataHash,
+	})
+	return nil
 }
 
 // ResetSession unloads any potentially stale state. Should be called
@@ -246,7 +255,10 @@ func (c *cache) GetSession(token string) (arvados.CustomFileSystem, *cachedSessi
 	} else {
 		c.metrics.sessionHits.Inc()
 	}
-	go c.pruneSessions()
+	select {
+	case c.chPruneSessions <- struct{}{}:
+	default:
+	}
 	fs, _ := sess.fs.Load().(arvados.CustomFileSystem)
 	if fs != nil && !expired {
 		return fs, sess, nil
@@ -302,19 +314,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 	c.setupOnce.Do(c.setup)
 	c.metrics.requests.Inc()
 
-	permOK := false
-	permKey := arv.ApiToken + "\000" + targetID
-	if forceReload {
-	} else if ent, cached := c.permissions.Get(permKey); cached {
-		ent := ent.(*cachedPermission)
-		if ent.expire.Before(time.Now()) {
-			c.permissions.Remove(permKey)
-		} else {
-			permOK = true
-			c.metrics.permissionHits.Inc()
-		}
-	}
-
+	var pdhRefresh bool
 	var pdh string
 	if arvadosclient.PDHMatch(targetID) {
 		pdh = targetID
@@ -324,22 +324,26 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 			c.pdhs.Remove(targetID)
 		} else {
 			pdh = ent.pdh
+			pdhRefresh = forceReload || time.Now().After(ent.refresh)
 			c.metrics.pdhHits.Inc()
 		}
 	}
 
-	var collection *arvados.Collection
-	if pdh != "" {
-		collection = c.lookupCollection(arv.ApiToken + "\000" + pdh)
-	}
-
-	if collection != nil && permOK {
-		return collection, nil
-	} else if collection != nil {
-		// Ask API for current PDH for this targetID. Most
-		// likely, the cached PDH is still correct; if so,
-		// _and_ the current token has permission, we can
-		// use our cached manifest.
+	if pdh == "" {
+		// UUID->PDH mapping is not cached, might as well get
+		// the whole collection record and be done (below).
+	} else if cached := c.lookupCollection(arv.ApiToken + "\000" + pdh); cached == nil {
+		// PDH->manifest is not cached, might as well get the
+		// whole collection record (below).
+	} else if !pdhRefresh {
+		// We looked up UUID->PDH very recently, and we still
+		// have the manifest for that PDH.
+		return cached, nil
+	} else {
+		// Get current PDH for this UUID (and confirm we still
+		// have read permission).  Most likely, the cached PDH
+		// is still correct, in which case we can use our
+		// cached manifest.
 		c.metrics.apiCalls.Inc()
 		var current arvados.Collection
 		err := arv.Get("collections", targetID, selectPDH, &current)
@@ -347,47 +351,44 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
 			return nil, err
 		}
 		if current.PortableDataHash == pdh {
-			c.permissions.Add(permKey, &cachedPermission{
-				expire: time.Now().Add(time.Duration(c.config.TTL)),
-			})
-			if pdh != targetID {
-				c.pdhs.Add(targetID, &cachedPDH{
-					expire: time.Now().Add(time.Duration(c.config.UUIDTTL)),
-					pdh:    pdh,
-				})
-			}
-			return collection, err
+			// PDH has not changed, cached manifest is
+			// correct.
+			return cached, err
 		}
-		// PDH changed, but now we know we have
-		// permission -- and maybe we already have the
-		// new PDH in the cache.
-		if coll := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); coll != nil {
-			return coll, nil
+		if cached := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); cached != nil {
+			// PDH changed, and we already have the
+			// manifest for that new PDH.
+			return cached, nil
 		}
 	}
 
-	// Collection manifest is not cached.
+	// Either UUID->PDH is not cached, or PDH->manifest is not
+	// cached.
+	var retrieved arvados.Collection
 	c.metrics.apiCalls.Inc()
-	err := arv.Get("collections", targetID, nil, &collection)
+	err := arv.Get("collections", targetID, nil, &retrieved)
 	if err != nil {
 		return nil, err
 	}
 	exp := time.Now().Add(time.Duration(c.config.TTL))
-	c.permissions.Add(permKey, &cachedPermission{
-		expire: exp,
-	})
-	c.pdhs.Add(targetID, &cachedPDH{
-		expire: time.Now().Add(time.Duration(c.config.UUIDTTL)),
-		pdh:    collection.PortableDataHash,
-	})
-	c.collections.Add(arv.ApiToken+"\000"+collection.PortableDataHash, &cachedCollection{
+	if targetID != retrieved.PortableDataHash {
+		c.pdhs.Add(targetID, &cachedPDH{
+			expire:  exp,
+			refresh: time.Now().Add(time.Duration(c.config.UUIDTTL)),
+			pdh:     retrieved.PortableDataHash,
+		})
+	}
+	c.collections.Add(arv.ApiToken+"\000"+retrieved.PortableDataHash, &cachedCollection{
 		expire:     exp,
-		collection: collection,
+		collection: &retrieved,
 	})
-	if int64(len(collection.ManifestText)) > c.config.MaxCollectionBytes/int64(c.config.MaxCollectionEntries) {
-		go c.pruneCollections()
+	if int64(len(retrieved.ManifestText)) > c.config.MaxCollectionBytes/int64(c.config.MaxCollectionEntries) {
+		select {
+		case c.chPruneCollections <- struct{}{}:
+		default:
+		}
 	}
-	return collection, nil
+	return &retrieved, nil
 }
 
 // pruneCollections checks the total bytes occupied by manifest_text
diff --git a/services/keep-web/cache_test.go b/services/keep-web/cache_test.go
index 0a0eef6e4..80e00b02a 100644
--- a/services/keep-web/cache_test.go
+++ b/services/keep-web/cache_test.go
@@ -51,7 +51,6 @@ func (s *UnitSuite) TestCache(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 5",
 		"hits 4",
-		"permission_hits 4",
 		"pdh_hits 4",
 		"api_calls 1")
 
@@ -72,7 +71,6 @@ func (s *UnitSuite) TestCache(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 6",
 		"hits 4",
-		"permission_hits 4",
 		"pdh_hits 4",
 		"api_calls 2")
 
@@ -85,7 +83,6 @@ func (s *UnitSuite) TestCache(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 7",
 		"hits 5",
-		"permission_hits 5",
 		"pdh_hits 4",
 		"api_calls 2")
 
@@ -105,7 +102,6 @@ func (s *UnitSuite) TestCache(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 27",
 		"hits 23",
-		"permission_hits 23",
 		"pdh_hits 22",
 		"api_calls 4")
 }
@@ -125,9 +121,8 @@ func (s *UnitSuite) TestCacheForceReloadByPDH(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 4",
 		"hits 3",
-		"permission_hits 1",
 		"pdh_hits 0",
-		"api_calls 3")
+		"api_calls 1")
 }
 
 func (s *UnitSuite) TestCacheForceReloadByUUID(c *check.C) {
@@ -145,7 +140,6 @@ func (s *UnitSuite) TestCacheForceReloadByUUID(c *check.C) {
 	s.checkCacheMetrics(c, cache.registry,
 		"requests 4",
 		"hits 3",
-		"permission_hits 1",
 		"pdh_hits 3",
 		"api_calls 3")
 }
diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go
index e883e806c..a74b85b98 100644
--- a/services/keep-web/handler_test.go
+++ b/services/keep-web/handler_test.go
@@ -1067,7 +1067,7 @@ func (s *IntegrationSuite) TestFileContentType(c *check.C) {
 		contentType string
 	}{
 		{"picture.txt", "BMX bikes are small this year\n", "text/plain; charset=utf-8"},
-		{"picture.bmp", "BMX bikes are small this year\n", "image/x-ms-bmp"},
+		{"picture.bmp", "BMX bikes are small this year\n", "image/(x-ms-)?bmp"},
 		{"picture.jpg", "BMX bikes are small this year\n", "image/jpeg"},
 		{"picture1", "BMX bikes are small this year\n", "image/bmp"},            // content sniff; "BM" is the magic signature for .bmp
 		{"picture2", "Cars are small this year\n", "text/plain; charset=utf-8"}, // content sniff
@@ -1103,7 +1103,7 @@ func (s *IntegrationSuite) TestFileContentType(c *check.C) {
 		resp := httptest.NewRecorder()
 		s.testServer.Handler.ServeHTTP(resp, req)
 		c.Check(resp.Code, check.Equals, http.StatusOK)
-		c.Check(resp.Header().Get("Content-Type"), check.Equals, trial.contentType)
+		c.Check(resp.Header().Get("Content-Type"), check.Matches, trial.contentType)
 		c.Check(resp.Body.String(), check.Equals, trial.content)
 	}
 }
diff --git a/services/keep-web/server_test.go b/services/keep-web/server_test.go
index 21d767208..d59229520 100644
--- a/services/keep-web/server_test.go
+++ b/services/keep-web/server_test.go
@@ -393,7 +393,6 @@ func (s *IntegrationSuite) TestMetrics(c *check.C) {
 	c.Check(counters["arvados_keepweb_collectioncache_api_calls//"].Value, check.Equals, int64(2))
 	c.Check(counters["arvados_keepweb_collectioncache_hits//"].Value, check.Equals, int64(1))
 	c.Check(counters["arvados_keepweb_collectioncache_pdh_hits//"].Value, check.Equals, int64(1))
-	c.Check(counters["arvados_keepweb_collectioncache_permission_hits//"].Value, check.Equals, int64(1))
 	c.Check(gauges["arvados_keepweb_collectioncache_cached_manifests//"].Value, check.Equals, float64(1))
 	// FooCollection's cached manifest size is 45 ("1f4b0....+45") plus one 51-byte blob signature
 	c.Check(gauges["arvados_keepweb_sessions_cached_collection_bytes//"].Value, check.Equals, float64(45+51))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list