Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): Bump github.com/jonboulle/clockwork from 0.4.0 to 0.5.0 #3448

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions app/monitoringapi_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ func TestStartChecker(t *testing.T) {
}

// Advance clock for first tick.
advanceClock(clock, 10*time.Second)
advanceClock(t, ctx, clock, 10*time.Second)

// Advance clock for first epoch tick.
advanceClock(clock, 32*12*time.Second)
advanceClock(t, ctx, clock, 32*12*time.Second)

waitFor := 1 * time.Second
tickInterval := 1 * time.Millisecond
if tt.err != nil {
require.Eventually(t, func() bool {
advanceClock(clock, 10*time.Second)
advanceClock(t, ctx, clock, 10*time.Second)
err = readyErrFunc()
if !errors.Is(err, tt.err) {
t.Logf("Ignoring unexpected error, got=%v, want=%v", err, tt.err)
Expand All @@ -176,20 +176,23 @@ func TestStartChecker(t *testing.T) {
}, waitFor, tickInterval)
} else {
require.Eventually(t, func() bool {
advanceClock(clock, 12*time.Second)
advanceClock(t, ctx, clock, 12*time.Second)
return readyErrFunc() == nil
}, waitFor, tickInterval)
}
})
}
}

func advanceClock(clock clockwork.FakeClock, duration time.Duration) {
func advanceClock(t *testing.T, ctx context.Context, clock *clockwork.FakeClock, duration time.Duration) {
t.Helper()
numTickers := 2

// We wrap the Advance() calls with blockers to make sure that the ticker
// can go to sleep and produce ticks without time passing in parallel.
clock.BlockUntil(numTickers)
err := clock.BlockUntilContext(ctx, numTickers)
require.NoError(t, err)
clock.Advance(duration)
clock.BlockUntil(numTickers)
err = clock.BlockUntilContext(ctx, numTickers)
require.NoError(t, err)
}
4 changes: 4 additions & 0 deletions core/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,7 @@ func (c *testClock) NewTimer(time.Duration) clockwork.Timer {
func (c *testClock) AfterFunc(time.Duration, func()) clockwork.Timer {
panic("not supported")
}

func (c *testClock) Until(t time.Time) time.Duration {
panic("not supported")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/herumi/bls-eth-go-binary v1.36.1
github.com/holiman/uint256 v1.3.2
github.com/ipfs/go-log/v2 v2.5.1
github.com/jonboulle/clockwork v0.4.0
github.com/jonboulle/clockwork v0.5.0
github.com/jsternberg/zap-logfmt v1.3.0
github.com/libp2p/go-libp2p v0.37.2
github.com/libp2p/go-msgio v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569z
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jhump/protoreflect/v2 v2.0.0-beta.2 h1:qZU+rEZUOYTz1Bnhi3xbwn+VxdXkLVeEpAeZzVXLY88=
github.com/jhump/protoreflect/v2 v2.0.0-beta.2/go.mod h1:4tnOYkB/mq7QTyS3YKtVtNrJv4Psqout8HA1U+hZtgM=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc=
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down
Loading