Skip to content

Commit

Permalink
Merge pull request go-retry#4 from howbazaar/fix-test-dep
Browse files Browse the repository at this point in the history
Use testclock from juju/clock.
  • Loading branch information
rogpeppe authored Aug 21, 2018
2 parents a39ed32 + 87155f2 commit 2602fa8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module gopkg.in/retry.v1

require (
github.com/juju/clock v0.0.0-20180808021310-bab88fc67299
github.com/juju/errors v0.0.0-20180726005433-812b06ada177 // indirect
github.com/juju/loggo v0.0.0-20180524022052-584905176618 // indirect
github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/juju/clock v0.0.0-20180808021310-bab88fc67299 h1:K9nBHQ3UNqg/HhZkQnGG2AE4YxDyNmGS9FFT2gGegLQ=
github.com/juju/clock v0.0.0-20180808021310-bab88fc67299/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA=
github.com/juju/errors v0.0.0-20180726005433-812b06ada177 h1:UliPGoJWlIH3IkkFqnPy/xYF/2tkTRTZhMt8/CwGUvw=
github.com/juju/errors v0.0.0-20180726005433-812b06ada177/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
github.com/juju/loggo v0.0.0-20180524022052-584905176618 h1:MK144iBQF9hTSwBW/9eJm034bVoG30IshVm688T2hi8=
Expand Down
9 changes: 4 additions & 5 deletions retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ package retry_test // import "gopkg.in/retry.v1"
import (
"time"

"github.com/juju/testing"
"github.com/juju/clock/testclock"
gc "gopkg.in/check.v1"

"github.com/juju/utils/clock"
"gopkg.in/retry.v1"
)

Expand Down Expand Up @@ -89,7 +88,7 @@ func (*retrySuite) TestAttemptWithStop(c *gc.C) {
}

func (*retrySuite) TestAttemptWithLaterStop(c *gc.C) {
clock := testing.NewClock(time.Now())
clock := testclock.NewClock(time.Now())
stop := make(chan struct{})
done := make(chan struct{})
progress := make(chan struct{}, 10)
Expand Down Expand Up @@ -119,7 +118,7 @@ func (*retrySuite) TestAttemptWithLaterStop(c *gc.C) {
}

func (*retrySuite) TestAttemptWithMockClock(c *gc.C) {
clock := testing.NewClock(time.Now())
clock := testclock.NewClock(time.Now())
strategy := retry.Regular{
Delay: 5 * time.Second,
Total: 30 * time.Second,
Expand Down Expand Up @@ -402,7 +401,7 @@ func closeTo(d0, d1 time.Duration) bool {
}

type mockClock struct {
clock.Clock
retry.Clock

now time.Time
sleep func(d time.Duration)
Expand Down

0 comments on commit 2602fa8

Please sign in to comment.