Skip to content

Commit f97e110

Browse files
committed
Fix log mock
Signed-off-by: Thomas Thornton <thomaswilliamthornton@gmail.com>
1 parent 6c4bb39 commit f97e110

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

go/vt/vttablet/tabletmanager/vreplication/vplayer_flaky_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,16 +3668,18 @@ func TestPlayerStalls(t *testing.T) {
36683668
defer deleteTablet(addTablet(100))
36693669

36703670
// We want to check for the expected log messages.
3671-
ole := log.Errorf
3671+
ole := log.Error
36723672
logger := logutil.NewMemoryLogger()
3673-
log.Errorf = logger.Errorf
3673+
log.Error = func(args ...any) {
3674+
logger.Errorf("%s", fmt.Sprint(args...))
3675+
}
36743676

36753677
oldMinimumHeartbeatUpdateInterval := vreplicationMinimumHeartbeatUpdateInterval
36763678
oldProgressDeadline := vplayerProgressDeadline
36773679
oldRelayLogMaxItems := vttablet.DefaultVReplicationConfig.RelayLogMaxItems
36783680
oldRetryDelay := vttablet.DefaultVReplicationConfig.RetryDelay
36793681
defer func() {
3680-
log.Errorf = ole
3682+
log.Error = ole
36813683
vreplicationMinimumHeartbeatUpdateInterval = oldMinimumHeartbeatUpdateInterval
36823684
vplayerProgressDeadline = oldProgressDeadline
36833685
vttablet.DefaultVReplicationConfig.RelayLogMaxItems = oldRelayLogMaxItems

0 commit comments

Comments
 (0)