[arvados] updated: 2.6.0-400-g9cc06669c

git repository hosting git at public.arvados.org
Mon Aug 7 14:32:39 UTC 2023


Summary of changes:
 lib/dispatchcloud/dispatcher_test.go  | 1 +
 lib/dispatchcloud/test/stub_driver.go | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

       via  9cc06669c3e8694cb1b34ec5183ebcdeeaa29fcd (commit)
      from  bc7bbb6bfb85a68059572519cf6d6cb33d9778f6 (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 9cc06669c3e8694cb1b34ec5183ebcdeeaa29fcd
Author: Tom Clegg <tom at curii.com>
Date:   Mon Aug 7 10:31:56 2023 -0400

    20705: 10% failure on stub Create to ensure running error path.
    
    Fixes occasional test failures due to absence of rate-limiting errors.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/dispatchcloud/dispatcher_test.go b/lib/dispatchcloud/dispatcher_test.go
index 17121ffeb..4583a596e 100644
--- a/lib/dispatchcloud/dispatcher_test.go
+++ b/lib/dispatchcloud/dispatcher_test.go
@@ -49,6 +49,7 @@ func (s *DispatcherSuite) SetUpTest(c *check.C) {
 	s.stubDriver = &test.StubDriver{
 		HostKey:                   hostpriv,
 		AuthorizedKeys:            []ssh.PublicKey{dispatchpub},
+		ErrorRateCreate:           0.1,
 		ErrorRateDestroy:          0.1,
 		MinTimeBetweenCreateCalls: time.Millisecond,
 	}
diff --git a/lib/dispatchcloud/test/stub_driver.go b/lib/dispatchcloud/test/stub_driver.go
index e91878527..5ca83d263 100644
--- a/lib/dispatchcloud/test/stub_driver.go
+++ b/lib/dispatchcloud/test/stub_driver.go
@@ -45,7 +45,8 @@ type StubDriver struct {
 	Queue *Queue
 
 	// Frequency of artificially introduced errors on calls to
-	// Destroy. 0=always succeed, 1=always fail.
+	// Create and Destroy. 0=always succeed, 1=always fail.
+	ErrorRateCreate  float64
 	ErrorRateDestroy float64
 
 	// If Create() or Instances() is called too frequently, return
@@ -120,6 +121,9 @@ func (sis *StubInstanceSet) Create(it arvados.InstanceType, image cloud.ImageID,
 	if sis.allowCreateCall.After(time.Now()) {
 		return nil, RateLimitError{sis.allowCreateCall}
 	}
+	if math_rand.Float64() < sis.driver.ErrorRateCreate {
+		return nil, fmt.Errorf("StubInstanceSet: rand < ErrorRateCreate %f", sis.driver.ErrorRateCreate)
+	}
 	sis.allowCreateCall = time.Now().Add(sis.driver.MinTimeBetweenCreateCalls)
 	ak := sis.driver.AuthorizedKeys
 	if authKey != nil {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list