From 1ba4bcacece6b66608afedc3d83fd09371ffbff6 Mon Sep 17 00:00:00 2001 From: Alex Le Date: Tue, 16 Jul 2024 15:31:36 -0700 Subject: [PATCH] Fixed incorrect return value for mocked function (#6080) Signed-off-by: Alex Le --- pkg/compactor/compactor_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/compactor/compactor_test.go b/pkg/compactor/compactor_test.go index a886a86249..9092aa9700 100644 --- a/pkg/compactor/compactor_test.go +++ b/pkg/compactor/compactor_test.go @@ -1083,7 +1083,7 @@ func TestCompactor_ShouldSkipOutOrOrderBlocks(t *testing.T) { cfg.SkipBlocksWithOutOfOrderChunksEnabled = true c, tsdbCompac, tsdbPlanner, _, registry := prepare(t, cfg, bucketClient, nil) - tsdbCompac.On("CompactWithBlockPopulator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(b1, nil) + tsdbCompac.On("CompactWithBlockPopulator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]ulid.ULID{b1}, nil) tsdbPlanner.On("Plan", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]*metadata.Meta{ { @@ -1986,7 +1986,7 @@ func TestCompactor_ShouldNotTreatInterruptionsAsErrors(t *testing.T) { c, tsdbCompactor, tsdbPlanner, logs, registry := prepare(t, prepareConfig(), bucketClient, nil) ctx, cancel := context.WithCancel(context.Background()) - tsdbCompactor.On("CompactWithBlockPopulator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(ulid.ULID{}, context.Canceled).Run(func(args mock.Arguments) { + tsdbCompactor.On("CompactWithBlockPopulator", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]ulid.ULID{}, context.Canceled).Run(func(args mock.Arguments) { cancel() }) tsdbPlanner.On("Plan", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]*metadata.Meta{