Skip to content

Commit

Permalink
Resolve the conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Jun 25, 2024
1 parent ee24057 commit 3706cc5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 93 deletions.
75 changes: 0 additions & 75 deletions pkg/schedule/config/store_config_test.go

This file was deleted.

21 changes: 3 additions & 18 deletions pkg/typeutil/size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package typeutil
import (
"encoding/json"

"github.com/docker/go-units"
. "github.com/pingcap/check"
)

Expand All @@ -40,48 +41,32 @@ func (s *testSizeSuite) TestJSON(c *C) {
c.Assert(string(o), Equals, `"1.598TiB"`)
}

<<<<<<< HEAD:pkg/typeutil/size_test.go
func (s *testSizeSuite) TestParseMbFromText(c *C) {
testdata := []struct {
=======
func TestParseMbFromText(t *testing.T) {
const defaultValue = 2

re := require.New(t)
testCases := []struct {
>>>>>>> 6fbe73796 (config: fix the panic caused by zero RegionSplitSizeMB (#8324)):pkg/utils/typeutil/size_test.go
testdata := []struct {
body []string
size uint64
}{{
body: []string{"10Mib", "10MiB", "10M", "10MB"},
size: 10,
}, {
body: []string{"10GiB", "10Gib", "10G", "10GB"},
<<<<<<< HEAD:pkg/typeutil/size_test.go
size: uint64(10 * 1024),
=======
size: 10 * units.GiB / units.MiB,
}, {
body: []string{"1024KiB", "1048576"},
size: 1,
}, {
body: []string{"100KiB", "1023KiB", "1048575", "0"},
size: 0,
>>>>>>> 6fbe73796 (config: fix the panic caused by zero RegionSplitSizeMB (#8324)):pkg/utils/typeutil/size_test.go
}, {
body: []string{"10yiB", "10aib"},
size: defaultValue,
}}

<<<<<<< HEAD:pkg/typeutil/size_test.go
for _, t := range testdata {
for _, b := range t.body {
c.Assert(int(ParseMBFromText(b, 1)), Equals, int(t.size))
=======
for _, testCase := range testCases {
for _, b := range testCase.body {
re.Equal(testCase.size, ParseMBFromText(b, defaultValue))
>>>>>>> 6fbe73796 (config: fix the panic caused by zero RegionSplitSizeMB (#8324)):pkg/utils/typeutil/size_test.go
c.Assert(ParseMBFromText(b, defaultValue), Equals, t.size)
}
}
}
4 changes: 4 additions & 0 deletions server/config/store_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,8 @@ func (t *testTiKVConfigSuite) TestMergeCheck(c *C) {
c.Assert(config.CheckRegionKeys(v.keys, v.mergeKeys), NotNil)
}
}
// Test CheckRegionSize when the region split size is 0.
config.RegionSplitSize = "100KiB"
c.Assert(config.GetRegionSplitSize(), Equals, uint64(0))
c.Assert(config.CheckRegionSize(defaultRegionMaxSize, 50), IsNil)
}

0 comments on commit 3706cc5

Please sign in to comment.