[ARVADOS] updated: bf5d77baad2071af6eea514c76b4892cec4974a0
Git user
git at public.curoverse.com
Mon Apr 24 14:58:30 EDT 2017
Summary of changes:
sdk/go/dispatch/throttle_test.go | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
via bf5d77baad2071af6eea514c76b4892cec4974a0 (commit)
from 04bd6b08b9ac13d29ac05c9281850d430d71066d (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 bf5d77baad2071af6eea514c76b4892cec4974a0
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Apr 24 14:57:41 2017 -0400
Fix panic in test case (overwriting a locked sync.Mutex with an unlocked one).
No issue #
diff --git a/sdk/go/dispatch/throttle_test.go b/sdk/go/dispatch/throttle_test.go
index d91513e..a6286d9 100644
--- a/sdk/go/dispatch/throttle_test.go
+++ b/sdk/go/dispatch/throttle_test.go
@@ -18,21 +18,20 @@ type ThrottleTestSuite struct{}
func (*ThrottleTestSuite) TestThrottle(c *check.C) {
uuid := "zzzzz-zzzzz-zzzzzzzzzzzzzzz"
+ t0 := throttle{}
+ c.Check(t0.Check(uuid), check.Equals, true)
+ c.Check(t0.Check(uuid), check.Equals, true)
- t := throttle{}
- c.Check(t.Check(uuid), check.Equals, true)
- c.Check(t.Check(uuid), check.Equals, true)
-
- t = throttle{hold: time.Nanosecond}
- c.Check(t.Check(uuid), check.Equals, true)
+ tNs := throttle{hold: time.Nanosecond}
+ c.Check(tNs.Check(uuid), check.Equals, true)
time.Sleep(time.Microsecond)
- c.Check(t.Check(uuid), check.Equals, true)
-
- t = throttle{hold: time.Minute}
- c.Check(t.Check(uuid), check.Equals, true)
- c.Check(t.Check(uuid), check.Equals, false)
- c.Check(t.Check(uuid), check.Equals, false)
- t.seen[uuid].last = time.Now().Add(-time.Hour)
- c.Check(t.Check(uuid), check.Equals, true)
- c.Check(t.Check(uuid), check.Equals, false)
+ c.Check(tNs.Check(uuid), check.Equals, true)
+
+ tMin := throttle{hold: time.Minute}
+ c.Check(tMin.Check(uuid), check.Equals, true)
+ c.Check(tMin.Check(uuid), check.Equals, false)
+ c.Check(tMin.Check(uuid), check.Equals, false)
+ tMin.seen[uuid].last = time.Now().Add(-time.Hour)
+ c.Check(tMin.Check(uuid), check.Equals, true)
+ c.Check(tMin.Check(uuid), check.Equals, false)
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list