Skip to content

Commit

Permalink
Call NewMaxReplicationLagModule to address panic
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Jun 7, 2024
1 parent d7dd1c6 commit b39a72a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion go/vt/throttler/throttler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,16 @@ func TestThreadFinished_SecondCallPanics(t *testing.T) {

func TestThrottlerMaxLag(t *testing.T) {
fc := &fakeClock{}
throttler, _ := newThrottlerWithClock("test", "queries", 1, 1, 10, fc.now)
throttler, _ := newThrottlerWithClock("test", "queries", 1, 1, ReplicationLagModuleDisabled, fc.now)
defer throttler.Close()

var err error
ratesHistory := newFakeRatesHistory()
fc.setNow(1 * time.Second)
config := NewMaxReplicationLagModuleConfig(10)
throttler.maxReplicationLagModule, err = NewMaxReplicationLagModule(config, ratesHistory.aggregatedIntervalHistory, fc.now)
require.NoError(t, err)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

Expand Down

0 comments on commit b39a72a

Please sign in to comment.