Skip to content

Commit 865d114

Browse files
build(deps): Bump github.com/jonboulle/clockwork from 0.4.0 to 0.5.0 (#6583)
Bumps [github.com/jonboulle/clockwork](https://github.com/jonboulle/clockwork) from 0.4.0 to 0.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/jonboulle/clockwork/releases">github.com/jonboulle/clockwork's releases</a>.</em></p> <blockquote> <h2>v0.5.0</h2> <!-- raw HTML omitted --> <h2>What's Changed</h2> <h3>Enhancements 🚀</h3> <ul> <li>Convert FakeClock to a struct. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/71">jonboulle/clockwork#71</a></li> </ul> <h3>Dependency Updates ⬆️</h3> <ul> <li>build(deps): bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/73">jonboulle/clockwork#73</a></li> <li>build(deps): bump actions/setup-go from 4 to 5 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/80">jonboulle/clockwork#80</a></li> <li>build(deps): bump github/codeql-action from 2 to 3 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/81">jonboulle/clockwork#81</a></li> </ul> <h3>Other Changes</h3> <ul> <li>Make NewTicker panic if d&lt;=0, like time.NewTicker. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/70">jonboulle/clockwork#70</a></li> <li>Fix typos and grammar issue by <a href="https://github.com/alexandear"><code>@​alexandear</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/72">jonboulle/clockwork#72</a></li> <li>Set minimal workflow permissions by <a href="https://github.com/pnacht"><code>@​pnacht</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/75">jonboulle/clockwork#75</a></li> <li>Add security policy by <a href="https://github.com/pnacht"><code>@​pnacht</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/78">jonboulle/clockwork#78</a></li> <li>add Until method on clock interface by <a href="https://github.com/WillMatthews"><code>@​WillMatthews</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/85">jonboulle/clockwork#85</a></li> <li>Bump Go version to 1.21. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/89">jonboulle/clockwork#89</a></li> <li>Remove some duplication &amp; use slices package. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/90">jonboulle/clockwork#90</a></li> <li>Standardize tests for core clockwork functions. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/91">jonboulle/clockwork#91</a></li> <li>Add contexts that use FakeClock rather than the system time. by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/92">jonboulle/clockwork#92</a></li> <li>Remove firer struct &amp; fix ticker reset by <a href="https://github.com/DPJacques"><code>@​DPJacques</code></a> in <a href="https://redirect.github.com/jonboulle/clockwork/pull/95">jonboulle/clockwork#95</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/alexandear"><code>@​alexandear</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/72">jonboulle/clockwork#72</a></li> <li><a href="https://github.com/pnacht"><code>@​pnacht</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/75">jonboulle/clockwork#75</a></li> <li><a href="https://github.com/WillMatthews"><code>@​WillMatthews</code></a> made their first contribution in <a href="https://redirect.github.com/jonboulle/clockwork/pull/85">jonboulle/clockwork#85</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0">https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/jonboulle/clockwork/commit/6d8d032a18422c2e3ef651170a8a55012d1f704c"><code>6d8d032</code></a> Remove firer struct &amp; fix ticker reset (<a href="https://redirect.github.com/jonboulle/clockwork/issues/95">#95</a>)</li> <li><a href="https://github.com/jonboulle/clockwork/commit/91d2c0adaca249481d9c61dd194383fa62d30826"><code>91d2c0a</code></a> Add contexts that use FakeClock rather than the system time. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/92">#92</a>)</li> <li><a href="https://github.com/jonboulle/clockwork/commit/7e524bd2b23863a60332249b53a095fc9370603a"><code>7e524bd</code></a> Standardize tests for core clockwork functions. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/91">#91</a>)</li> <li><a href="https://github.com/jonboulle/clockwork/commit/11a247d8fc82069355fd024bc08d4ad4366c0013"><code>11a247d</code></a> Remove some duplication &amp; use slices package. (<a href="https://redirect.github.com/jonboulle/clockwork/issues/90">#90</a>)</li> <li><a href="https://github.com/jonboulle/clockwork/commit/fe91b0de93b9f79240e9f4ed093120db61f49ee7"><code>fe91b0d</code></a> Bump Go verison to 1.21.</li> <li><a href="https://github.com/jonboulle/clockwork/commit/33fc064cceda86a937e85a0b01309974970c6a52"><code>33fc064</code></a> add Until method on clocks</li> <li><a href="https://github.com/jonboulle/clockwork/commit/fc59783b0293939df2ade8872f0e8cfd87c9dbfe"><code>fc59783</code></a> build(deps): bump github/codeql-action from 2 to 3</li> <li><a href="https://github.com/jonboulle/clockwork/commit/5c13cb81e3298b37d5623bda1034c01e324de26e"><code>5c13cb8</code></a> Merge pull request <a href="https://redirect.github.com/jonboulle/clockwork/issues/80">#80</a> from jonboulle/dependabot/github_actions/actions/setup...</li> <li><a href="https://github.com/jonboulle/clockwork/commit/72da535d7ba42700d02c4976b2dc4fd95e716b1d"><code>72da535</code></a> Update documentaiton on interactions with context.</li> <li><a href="https://github.com/jonboulle/clockwork/commit/5508bca6cc96e1dcbb467049b40ec773b64c5d77"><code>5508bca</code></a> build(deps): bump actions/setup-go from 4 to 5</li> <li>Additional commits viewable in <a href="https://github.com/jonboulle/clockwork/compare/v0.4.0...v0.5.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/jonboulle/clockwork&package-manager=go_modules&previous-version=0.4.0&new-version=0.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Co-authored-by: Bartosz Różański <[email protected]>
1 parent 2e6b90a commit 865d114

File tree

9 files changed

+18
-33
lines changed

9 files changed

+18
-33
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/hashicorp/golang-lru/v2 v2.0.7
2020
github.com/ipfs/go-ds-leveldb v0.5.0
2121
github.com/ipfs/go-log/v2 v2.5.1
22-
github.com/jonboulle/clockwork v0.4.0
22+
github.com/jonboulle/clockwork v0.5.0
2323
github.com/libp2p/go-libp2p v0.38.1
2424
github.com/libp2p/go-libp2p-kad-dht v0.28.1
2525
github.com/libp2p/go-libp2p-pubsub v0.12.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl
333333
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
334334
github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4=
335335
github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc=
336-
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
337-
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
336+
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
337+
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
338338
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
339339
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
340340
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=

hare3/hare_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type node struct {
112112
t *tester
113113

114114
i int
115-
clock clockwork.FakeClock
115+
clock *clockwork.FakeClock
116116
nclock *testNodeClock
117117
signer *signing.EdSigner
118118
registered []*signing.EdSigner

hare4/hare_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type node struct {
116116
t *tester
117117

118118
i int
119-
clock clockwork.FakeClock
119+
clock *clockwork.FakeClock
120120
nclock *testNodeClock
121121
signer *signing.EdSigner
122122
registered []*signing.EdSigner

miner/active_set_generator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type testerActiveSetGenerator struct {
9999
localdb sql.LocalDatabase
100100
atxsdata *atxsdata.Data
101101
clock *mocks.MocklayerClock
102-
wallclock clockwork.FakeClock
102+
wallclock *clockwork.FakeClock
103103
}
104104

105105
func TestActiveSetGenerate(t *testing.T) {
@@ -319,7 +319,7 @@ func TestActiveSetEnsure(t *testing.T) {
319319
}()
320320
go func() {
321321
for i := 0; i < tries; i++ {
322-
tester.wallclock.BlockUntil(1)
322+
tester.wallclock.BlockUntilContext(context.Background(), 1)
323323
tester.wallclock.Advance(tester.gen.cfg.activeSet.RetryInterval)
324324
}
325325
}()

sync2/atxs_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,7 @@ func TestAtxHandler_Retry(t *testing.T) {
144144
var eg errgroup.Group
145145
eg.Go(func() error {
146146
for {
147-
// FIXME: BlockUntilContext is not included in FakeClock interface.
148-
// This will be fixed in a post-0.4.0 clockwork release, but with a breaking change that
149-
// makes FakeClock a struct instead of an interface.
150-
// See: https://github.com/jonboulle/clockwork/pull/71
151-
clock.(interface {
152-
BlockUntilContext(ctx context.Context, n int) error
153-
}).BlockUntilContext(ctx, 1)
147+
clock.BlockUntilContext(ctx, 1)
154148
if ctx.Err() != nil {
155149
return nil
156150
}
@@ -213,7 +207,7 @@ func TestAtxHandler_BatchRetry(t *testing.T) {
213207
return h.Commit(context.Background(), peer, baseSet, atxSeqResult(allAtxs))
214208
})
215209
// wait for delay after 1st batch failure
216-
clock.BlockUntil(1)
210+
clock.BlockUntilContext(context.Background(), 1)
217211
toFetch := make(map[types.ATXID]bool)
218212
for _, id := range allAtxs {
219213
toFetch[id] = true
@@ -272,7 +266,7 @@ func TestAtxHandler_BatchRetry_Fail(t *testing.T) {
272266
return h.Commit(context.Background(), peer, baseSet, sr)
273267
})
274268
for range 2 {
275-
clock.BlockUntil(1)
269+
clock.BlockUntilContext(context.Background(), 1)
276270
clock.Advance(testCfg.FailedBatchDelay)
277271
}
278272
require.Error(t, eg.Wait())

sync2/multipeer/multipeer_test.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ const (
2727
numSyncPeers = 6
2828
)
2929

30-
// FIXME: BlockUntilContext is not included in FakeClock interface.
31-
// This will be fixed in a post-0.4.0 clockwork release, but with a breaking change that
32-
// makes FakeClock a struct instead of an interface.
33-
// See: https://github.com/jonboulle/clockwork/pull/71
34-
type fakeClock interface {
35-
clockwork.FakeClock
36-
BlockUntilContext(ctx context.Context, n int) error
37-
}
38-
3930
type peerList struct {
4031
sync.Mutex
4132
peers []p2p.Peer
@@ -63,7 +54,7 @@ type multiPeerSyncTester struct {
6354
syncBase *MockSyncBase
6455
syncRunner *MocksyncRunner
6556
peers *peers.Peers
66-
clock fakeClock
57+
clock *clockwork.FakeClock
6758
reconciler *multipeer.MultiPeerReconciler
6859
cancel context.CancelFunc
6960
eg errgroup.Group
@@ -81,7 +72,7 @@ func newMultiPeerSyncTester(t *testing.T, addPeers int) *multiPeerSyncTester {
8172
syncBase: NewMockSyncBase(ctrl),
8273
syncRunner: NewMocksyncRunner(ctrl),
8374
peers: peers.New(),
84-
clock: clockwork.NewFakeClock().(fakeClock),
75+
clock: clockwork.NewFakeClock(),
8576
kickCh: make(chan struct{}, 1),
8677
}
8778
cfg := multipeer.DefaultConfig()

sync2/multipeer/split_sync_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
type splitSyncTester struct {
2525
testing.TB
2626
syncPeers []p2p.Peer
27-
clock clockwork.FakeClock
27+
clock *clockwork.FakeClock
2828
mtx sync.Mutex
2929
fail map[hexRange]bool
3030
expPeerRanges map[hexRange]int
@@ -174,7 +174,7 @@ func TestSplitSync_SlowPeers(t *testing.T) {
174174
return len(tst.peerRanges) == 2
175175
}, 10*time.Millisecond, time.Millisecond)
176176
// Make sure all 4 grace period timers are started.
177-
tst.clock.BlockUntil(4)
177+
tst.clock.BlockUntilContext(context.Background(), 4)
178178
tst.clock.Advance(time.Minute)
179179
require.NoError(t, eg.Wait())
180180
for pr, count := range tst.expPeerRanges {

syncer/malsync/syncer_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ type tester struct {
141141
db sql.StateDatabase
142142
cfg Config
143143
fetcher *mocks.Mockfetcher
144-
clock clockwork.FakeClock
144+
clock *clockwork.FakeClock
145145
received map[types.NodeID]bool
146146
attempts map[types.NodeID]int
147147
peers []p2p.Peer
@@ -280,16 +280,16 @@ func TestSyncer(t *testing.T) {
280280
require.ErrorIs(t, tester.syncer.DownloadLoop(ctx), context.Canceled)
281281
return nil
282282
})
283-
tester.clock.BlockUntil(1)
283+
tester.clock.BlockUntilContext(context.Background(), 1)
284284
tester.clock.Advance(tester.cfg.IDRequestInterval)
285285
ch <- nil
286-
tester.clock.BlockUntil(1)
286+
tester.clock.BlockUntilContext(context.Background(), 1)
287287
tester.clock.Advance(tester.cfg.IDRequestInterval)
288288

289289
tester.expectGetMaliciousIDs()
290290
tester.expectGetProofs(nil)
291291
ch <- tester.peers
292-
tester.clock.BlockUntil(1)
292+
tester.clock.BlockUntilContext(context.Background(), 1)
293293
cancel()
294294
eg.Wait()
295295
})

0 commit comments

Comments
 (0)