16739: remove throttle.ResetError, update the err field directly from
authorWard Vandewege <ward@curii.com>
Tue, 1 Sep 2020 14:23:33 +0000 (10:23 -0400)
committerWard Vandewege <ward@curii.com>
Tue, 1 Sep 2020 14:23:33 +0000 (10:23 -0400)
       the test.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

lib/dispatchcloud/worker/pool_test.go
lib/dispatchcloud/worker/throttle.go

index 7b116c3eefb09cdba27043598786f711a9c7cf53..a85f7383ab3cdc59fcc1bd0e7ad936703666ca2f 100644 (file)
@@ -224,14 +224,14 @@ func (suite *PoolSuite) TestNodeCreateThrottle(c *check.C) {
        c.Check(pool.Unallocated()[type1], check.Equals, 1)
        c.Check(res, check.Equals, false)
 
-       pool.instanceSet.throttleCreate.ResetError()
+       pool.instanceSet.throttleCreate.err = nil
        pool.maxConcurrentInstanceCreateOps = 2
 
        res = pool.Create(type1)
        c.Check(pool.Unallocated()[type1], check.Equals, 2)
        c.Check(res, check.Equals, true)
 
-       pool.instanceSet.throttleCreate.ResetError()
+       pool.instanceSet.throttleCreate.err = nil
        pool.maxConcurrentInstanceCreateOps = 0
 
        res = pool.Create(type1)
index 5374afb44fccb0408e26039a8c53b1bfa1f8481d..defbf91ff38390d22062aa03d1f3f34149428e27 100644 (file)
@@ -61,12 +61,6 @@ func (thr *throttle) Error() error {
        return thr.err
 }
 
-func (thr *throttle) ResetError() {
-       thr.mtx.Lock()
-       defer thr.mtx.Unlock()
-       thr.err = nil
-}
-
 type throttledInstanceSet struct {
        cloud.InstanceSet
        throttleCreate    throttle