[ARVADOS] updated: 2.1.0-1545-g39a723673

Git user git at public.arvados.org
Wed Oct 27 19:36:32 UTC 2021


Summary of changes:
 services/keep-web/handler_test.go | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

       via  39a723673e92b842233b1da5fde27aa595fcc59f (commit)
      from  83c996d75698093446fbfff89ea4abeb36cbc8c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 39a723673e92b842233b1da5fde27aa595fcc59f
Author: Tom Clegg <tom at curii.com>
Date:   Wed Oct 27 15:33:09 2021 -0400

    16347: Fix race in test helper func.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go
index 55c122b0f..6412789ff 100644
--- a/services/keep-web/handler_test.go
+++ b/services/keep-web/handler_test.go
@@ -1202,7 +1202,6 @@ func (s *IntegrationSuite) checkUploadDownloadRequest(c *check.C, h *handler, re
 	c.Check(err, check.IsNil)
 	c.Check(logentries.Items, check.HasLen, 1)
 	lastLogId := logentries.Items[0].ID
-	nextLogId := lastLogId
 
 	var logbuf bytes.Buffer
 	logger := logrus.New()
@@ -1216,24 +1215,29 @@ func (s *IntegrationSuite) checkUploadDownloadRequest(c *check.C, h *handler, re
 		c.Check(logbuf.String(), check.Matches, `(?ms).*msg="File `+direction+`".*`)
 		c.Check(logbuf.String(), check.Not(check.Matches), `(?ms).*level=error.*`)
 
-		count := 0
-		for ; nextLogId == lastLogId && count < 20; count++ {
-			time.Sleep(50 * time.Millisecond)
+		deadline := time.Now().Add(time.Second)
+		for {
+			c.Assert(time.Now().After(deadline), check.Equals, false, check.Commentf("timed out waiting for log entry"))
 			err = client.RequestAndDecode(&logentries, "GET", "arvados/v1/logs", nil,
 				arvados.ResourceListParams{
-					Filters: []arvados.Filter{arvados.Filter{Attr: "event_type", Operator: "=", Operand: "file_" + direction}},
-					Limit:   &limit1,
-					Order:   "created_at desc",
+					Filters: []arvados.Filter{
+						{Attr: "event_type", Operator: "=", Operand: "file_" + direction},
+						{Attr: "object_uuid", Operator: "=", Operand: userUuid},
+					},
+					Limit: &limit1,
+					Order: "created_at desc",
 				})
-			c.Check(err, check.IsNil)
-			if len(logentries.Items) > 0 {
-				nextLogId = logentries.Items[0].ID
+			c.Assert(err, check.IsNil)
+			if len(logentries.Items) > 0 &&
+				logentries.Items[0].ID > lastLogId &&
+				logentries.Items[0].ObjectUUID == userUuid &&
+				logentries.Items[0].Properties["collection_uuid"] == collectionUuid &&
+				logentries.Items[0].Properties["collection_file_path"] == filepath {
+				break
 			}
+			c.Logf("logentries.Items: %+v", logentries.Items)
+			time.Sleep(50 * time.Millisecond)
 		}
-		c.Check(count, check.Not(check.Equals), 20)
-		c.Check(logentries.Items[0].ObjectUUID, check.Equals, userUuid)
-		c.Check(logentries.Items[0].Properties["collection_uuid"], check.Equals, collectionUuid)
-		c.Check(logentries.Items[0].Properties["collection_file_path"], check.Equals, filepath)
 	} else {
 		c.Check(resp.Result().StatusCode, check.Equals, http.StatusForbidden)
 		c.Check(logbuf.String(), check.Equals, "")

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list