X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d9c447c1a53c03493fb1dd51a8eeb3f0022d07d5..e7a24aee9c68263e334547875bf0f9af0389b86d:/services/keep-web/handler_test.go diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go index 60fe4acc46..4a76276392 100644 --- a/services/keep-web/handler_test.go +++ b/services/keep-web/handler_test.go @@ -1627,12 +1627,16 @@ func (s *IntegrationSuite) TestUploadLoggingPermission(c *check.C) { } func (s *IntegrationSuite) TestConcurrentWrites(c *check.C) { + s.handler.Cluster.Collections.WebDAVCache.TTL = arvados.Duration(time.Second * 2) + lockTidyInterval = time.Second client := arvados.NewClientFromEnv() client.AuthToken = arvadostest.ActiveTokenV2 - // Start small, and increase concurrency (2^2, 4^2, 8^2, 16^2) + // Start small, and increase concurrency (2^2, 4^2, ...) // only until hitting failure. Avoids unnecessarily long // failure reports. - for n := 2; n < 32 && !c.Failed(); n++ { + for n := 2; n < 16 && !c.Failed(); n = n * 2 { + c.Logf("%s: n=%d", c.TestName(), n) + var coll arvados.Collection err := client.RequestAndDecode(&coll, "POST", "arvados/v1/collections", nil, nil) c.Assert(err, check.IsNil) @@ -1679,5 +1683,14 @@ func (s *IntegrationSuite) TestConcurrentWrites(c *check.C) { }() } wg.Wait() + for i := 0; i < n; i++ { + u := mustParseURL(fmt.Sprintf("http://%s.collections.example.com/i=%d", coll.UUID, i)) + resp := httptest.NewRecorder() + req, err := http.NewRequest("PROPFIND", u.String(), &bytes.Buffer{}) + c.Assert(err, check.IsNil) + req.Header.Set("Authorization", "Bearer "+client.AuthToken) + s.handler.ServeHTTP(resp, req) + c.Assert(resp.Code, check.Equals, http.StatusMultiStatus) + } } }