Skip to content

Commit 456d0b3

Browse files
committed
rangefeed: cleanup test output
A couple more cases of missing log.Scopes and some uses of fmt.Printf rather than t.Log. Epic: none Release note: None
1 parent fa483f1 commit 456d0b3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

pkg/kv/kvserver/rangefeed/catchup_scan_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ func TestCatchupScanInlineError(t *testing.T) {
278278

279279
func TestCatchupScanSeesOldIntent(t *testing.T) {
280280
defer leaktest.AfterTest(t)()
281+
defer log.Scope(t).Close(t)
282+
281283
// Regression test for [#85886]. When with-diff is specified, the iterator may
282284
// be positioned on an intent that is outside the time bounds. When we read
283285
// the intent and want to load the version, we must make sure to ignore time

pkg/kv/kvserver/rangefeed/processor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ func TestBudgetReleaseOnProcessorStop(t *testing.T) {
12001200
// after flushing the queue, but couldn't determine when main processor loop
12011201
// is actually closed.
12021202
testutils.SucceedsSoon(t, func() error {
1203-
fmt.Printf("Budget now: %d bytes remained, %d events processed\n",
1203+
t.Logf("budget: %d bytes remained, %d events processed",
12041204
m.AllocBytes(), rStream.Consumed())
12051205
if m.AllocBytes() != 0 {
12061206
return errors.Errorf(
@@ -1367,7 +1367,7 @@ func requireBudgetDrainedSoon(t *testing.T, b *FeedBudget, stream *consumer) {
13671367
b.mu.Lock()
13681368
used := b.mu.memBudget.Used()
13691369
b.mu.Unlock()
1370-
fmt.Printf("Budget used: %d bytes, %d events processed\n",
1370+
t.Logf("budget used: %d bytes, %d events processed",
13711371
used, stream.Consumed())
13721372
if used != 0 {
13731373
return errors.Errorf(

pkg/kv/kvserver/rangefeed/task_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
1919
"github.com/cockroachdb/cockroach/pkg/util/hlc"
2020
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
21+
"github.com/cockroachdb/cockroach/pkg/util/log"
2122
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
2223
"github.com/cockroachdb/cockroach/pkg/util/uuid"
2324
"github.com/stretchr/testify/require"
@@ -243,6 +244,7 @@ func (s *testIterator) RangeKeyChanged() bool {
243244

244245
func TestInitResolvedTSScan(t *testing.T) {
245246
defer leaktest.AfterTest(t)()
247+
defer log.Scope(t).Close(t)
246248
ctx := context.Background()
247249

248250
startKey := roachpb.RKey("d")

0 commit comments

Comments
 (0)