Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzix authored and ti-chi-bot committed Aug 10, 2021
1 parent c8e2701 commit d01245b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pkg/workerpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type EventHandle interface {
// SetTimer is used to provide a function that is periodic called, as long as the EventHandle has not been unregistered.
// The current implementation uses as the base clock source a ticker whose interval is the const workerPoolDefaultClockSourceInterval.
// DO NOT set an interval less than workerPoolDefaultClockSourceInterval.
// DO NOT set an interval less than workerPoolDefaultClockSourceInterval.
// Cancelling `ctx` here will cancel the on-going or next execution of `f`.
SetTimer(ctx context.Context, interval time.Duration, f func(ctx context.Context) error) EventHandle

Expand Down
2 changes: 1 addition & 1 deletion pkg/workerpool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (s *workerPoolSuite) TestCancelByAddEventContext(c *check.C) {
pool := newDefaultPoolImpl(&defaultHasher{}, 4)
go func() {
err := pool.Run(poolCtx)
c.Assert(err, check.IsNil)
c.Assert(err, check.ErrorMatches, ".*context canceled.*")
}()

ctx, cancel := context.WithTimeout(context.Background(), time.Second*20)
Expand Down

0 comments on commit d01245b

Please sign in to comment.