[arvados] updated: 2.7.0-5605-g8209e167b7

git repository hosting git at public.arvados.org
Wed Dec 13 15:19:30 UTC 2023


Summary of changes:
 .../client/api/client/CountingFileRequestBody.java | 43 +----------
 .../client/api/client/CountingRequestBody.java     | 52 +++++++++++++
 .../api/client/CountingStreamRequestBody.java      | 47 ++++++++++++
 .../client/api/client/KeepServerApiClient.java     |  2 +-
 .../client/api/client/KeepWebApiClient.java        | 11 +++
 services/keep-balance/balance_run_test.go          | 85 ++++++++++++++++------
 services/workbench2/Makefile                       |  3 +
 .../workbench2/cypress/integration/process.spec.js | 47 ++++++++++++
 services/workbench2/package.json                   |  4 +-
 .../process-logs-panel-actions.ts                  | 59 +++++++++++++--
 services/workbench2/yarn.lock                      | 47 +++++++++---
 services/ws/session_v0.go                          |  1 +
 12 files changed, 321 insertions(+), 80 deletions(-)
 create mode 100644 sdk/java-v2/src/main/java/org/arvados/client/api/client/CountingRequestBody.java
 create mode 100644 sdk/java-v2/src/main/java/org/arvados/client/api/client/CountingStreamRequestBody.java

       via  8209e167b7c32f7f233f54429390a7470a8127d9 (commit)
       via  1ab8d6123704e915f86ce37c6d425669f4cce90c (commit)
       via  b9c536f72871b980194fa54d783bfe09ef76cdd5 (commit)
       via  cb73538f0851cea402a0544861966c2515a24b5b (commit)
       via  9955d212e725d59450aada734c898594f1c11fd2 (commit)
       via  095e176632bbf81d28a239742a1ecce12404bd2d (commit)
       via  b774da617da87999f68863b90542dd41d9ba0bd3 (commit)
       via  66897bc5cef798a8bfc2a3426568914dcaf15759 (commit)
       via  78f785dabc247454726845de9cdf48eb4d5b7a0d (commit)
       via  2c7f44ed77a3df21088ec608f6a5d58dd7f65518 (commit)
       via  e06a65d3deb59887fed473e27c3eebd8aefa5090 (commit)
       via  1875ec0fead829272cc609f9d1431f4922633d49 (commit)
      from  9251549928dd5206d4a14e5f9811caa66aa64c65 (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 8209e167b7c32f7f233f54429390a7470a8127d9
Author: Tom Clegg <tom at curii.com>
Date:   Wed Dec 13 10:18:30 2023 -0500

    21254: Split TestRunForever into timer- and signal-triggered tests.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/services/keep-balance/balance_run_test.go b/services/keep-balance/balance_run_test.go
index fefd2c6c1b..f66194e2a2 100644
--- a/services/keep-balance/balance_run_test.go
+++ b/services/keep-balance/balance_run_test.go
@@ -624,7 +624,7 @@ func (s *runSuite) TestChunkPrefix(c *check.C) {
 	c.Check(string(lost), check.Equals, "")
 }
 
-func (s *runSuite) TestRunForever(c *check.C) {
+func (s *runSuite) TestRunForever_TriggeredByTimer(c *check.C) {
 	s.config.ManagementToken = "xyzzy"
 	opts := RunOptions{
 		Logger: ctxlog.TestLogger(c),
@@ -640,7 +640,57 @@ func (s *runSuite) TestRunForever(c *check.C) {
 
 	ctx, cancel := context.WithCancel(context.Background())
 	defer cancel()
-	s.config.Collections.BalancePeriod = arvados.Duration(100 * time.Millisecond)
+	s.config.Collections.BalancePeriod = arvados.Duration(10 * time.Millisecond)
+	srv := s.newServer(&opts)
+
+	done := make(chan bool)
+	go func() {
+		srv.runForever(ctx)
+		close(done)
+	}()
+
+	// Each run should send 4 pull lists + 4 trash lists. The
+	// first run should also send 4 empty trash lists at
+	// startup. We should complete at least four runs in much less
+	// than 10s.
+	for t0 := time.Now(); time.Since(t0) < 10*time.Second; {
+		pulls := pullReqs.Count()
+		if pulls >= 16 && trashReqs.Count() == pulls+4 {
+			break
+		}
+		time.Sleep(time.Millisecond)
+	}
+	cancel()
+	<-done
+	c.Check(pullReqs.Count() >= 16, check.Equals, true)
+	c.Check(trashReqs.Count() >= 20, check.Equals, true)
+
+	// We should have completed 4 runs before calling cancel().
+	// But the next run might also have started before we called
+	// cancel(), in which case the extra run will be included in
+	// the changeset_compute_seconds_count metric.
+	completed := pullReqs.Count() / 4
+	metrics := arvadostest.GatherMetricsAsString(srv.Metrics.reg)
+	c.Check(metrics, check.Matches, fmt.Sprintf(`(?ms).*\narvados_keepbalance_changeset_compute_seconds_count (%d|%d)\n.*`, completed, completed+1))
+}
+
+func (s *runSuite) TestRunForever_TriggeredBySignal(c *check.C) {
+	s.config.ManagementToken = "xyzzy"
+	opts := RunOptions{
+		Logger: ctxlog.TestLogger(c),
+		Dumper: ctxlog.TestLogger(c),
+	}
+	s.stub.serveCurrentUserAdmin()
+	s.stub.serveFooBarFileCollections()
+	s.stub.serveKeepServices(stubServices)
+	s.stub.serveKeepstoreMounts()
+	s.stub.serveKeepstoreIndexFoo4Bar1()
+	trashReqs := s.stub.serveKeepstoreTrash()
+	pullReqs := s.stub.serveKeepstorePull()
+
+	ctx, cancel := context.WithCancel(context.Background())
+	defer cancel()
+	s.config.Collections.BalancePeriod = arvados.Duration(time.Minute)
 	srv := s.newServer(&opts)
 
 	done := make(chan bool)
@@ -654,36 +704,29 @@ func (s *runSuite) TestRunForever(c *check.C) {
 
 	// Each run should send 4 pull lists + 4 trash lists. The
 	// first run should also send 4 empty trash lists at
-	// startup. We should complete all four runs in much less than
-	// a second.
+	// startup. We should be able to complete four runs in much
+	// less than 10s.
 	completedRuns := 0
 	for t0 := time.Now(); time.Since(t0) < 10*time.Second; {
 		pulls := pullReqs.Count()
 		if pulls >= 16 && trashReqs.Count() == pulls+4 {
 			break
 		}
-		if pulls > 4 {
-			// Once the 2nd run has started automatically
-			// (indicating that our BalancePeriod is
-			// working) we switch to a long wait time to
-			// effectively stop the timed runs, and
-			// instead start sending a single SIGUSR1 at
-			// the end of each (2nd or 3rd) run, to ensure
-			// we get exactly 4 runs in total.
-			srv.Cluster.Collections.BalancePeriod = arvados.Duration(time.Minute)
-			if pulls%4 == 0 && pulls <= 12 && pulls/4 > completedRuns {
-				completedRuns = pulls / 4
-				c.Logf("completed run %d, sending SIGUSR1 to trigger next run", completedRuns)
-				procself.Signal(syscall.SIGUSR1)
-			}
+		// Once the 1st run has started automatically, we
+		// start sending a single SIGUSR1 at the end of each
+		// run, to ensure we get exactly 4 runs in total.
+		if pulls > 0 && pulls%4 == 0 && pulls <= 12 && pulls/4 > completedRuns {
+			completedRuns = pulls / 4
+			c.Logf("completed run %d, sending SIGUSR1 to trigger next run", completedRuns)
+			procself.Signal(syscall.SIGUSR1)
 		}
 		time.Sleep(time.Millisecond)
 	}
 	cancel()
 	<-done
-	c.Check(pullReqs.Count() >= 16, check.Equals, true)
-	c.Check(trashReqs.Count(), check.Equals, pullReqs.Count()+4)
+	c.Check(pullReqs.Count(), check.Equals, 16)
+	c.Check(trashReqs.Count(), check.Equals, 20)
 
 	metrics := arvadostest.GatherMetricsAsString(srv.Metrics.reg)
-	c.Check(metrics, check.Matches, `(?ms).*\narvados_keepbalance_changeset_compute_seconds_count `+fmt.Sprintf("%d", pullReqs.Count()/4)+`\n.*`)
+	c.Check(metrics, check.Matches, `(?ms).*\narvados_keepbalance_changeset_compute_seconds_count 4\n.*`)
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list