Skip to content

Commit

Permalink
This is an automated cherry-pick of #8702
Browse files Browse the repository at this point in the history
close #8698

Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
lhy1024 authored and ti-chi-bot committed Jan 26, 2025
1 parent 3e55a4f commit 77101ae
Show file tree
Hide file tree
Showing 12 changed files with 4,805 additions and 20 deletions.
19 changes: 19 additions & 0 deletions pkg/assertutil/assertutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,34 @@ import (
"testing"

"github.com/stretchr/testify/require"
<<<<<<< HEAD:pkg/assertutil/assertutil_test.go

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / statics

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / tso-function-test

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (1)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (2)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (3)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (4)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (5)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (6)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (7)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (8)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (9)

expected 'STRING', found '<<'

Check failure on line 22 in pkg/assertutil/assertutil_test.go

View workflow job for this annotation

GitHub Actions / chunks (10)

expected 'STRING', found '<<'
=======
"github.com/tikv/pd/pkg/core"
"github.com/tikv/pd/pkg/statistics/utils"
>>>>>>> 20087e290 (statistics: add gc in hot peer cache (#8702)):pkg/statistics/hot_cache_test.go
)

func TestNilFail(t *testing.T) {
t.Parallel()
re := require.New(t)
<<<<<<< HEAD:pkg/assertutil/assertutil_test.go
var failErr error
checker := NewChecker()
checker.FailNow = func() {
failErr = errors.New("called assert func not exist")
=======
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
for i := utils.RWType(0); i < utils.RWTypeLen; i++ {
cluster := core.NewBasicCluster()
cache := NewHotCache(ctx, cluster)
region := buildRegion(cluster, i, 3, 60)
stats := cache.CheckReadPeerSync(region, region.GetPeers(), []float64{100000000, 1000, 1000}, 60)
cache.Update(stats[0], i)
for range 100 {
re.True(cache.IsRegionHot(region, 1))
}
>>>>>>> 20087e290 (statistics: add gc in hot peer cache (#8702)):pkg/statistics/hot_cache_test.go
}
re.Nil(checker.IsNil)
checker.AssertNil(nil)
Expand Down
Loading

0 comments on commit 77101ae

Please sign in to comment.