Skip to content

Commit

Permalink
Fix the test
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Jun 28, 2023
1 parent 8093b64 commit 30cf388
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/keyspace/tso_keyspace_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ func (suite *keyspaceGroupTestSuite) TestKeyspaceGroupSplit() {

keyspaceGroups := []*endpoint.KeyspaceGroup{
{
ID: uint32(1),
UserKind: endpoint.Basic.String(),
ID: uint32(1),
UserKind: endpoint.Basic.String(),
Keyspaces: []uint32{444},
},
{
ID: uint32(2),
Expand All @@ -254,7 +255,7 @@ func (suite *keyspaceGroupTestSuite) TestKeyspaceGroupSplit() {
err = suite.kgm.SplitKeyspaceGroupByID(0, 4, []uint32{utils.DefaultKeyspaceID})
re.ErrorIs(err, ErrModifyDefaultKeyspace)
// split the keyspace group 1 to 4
err = suite.kgm.SplitKeyspaceGroupByID(1, 4, []uint32{333})
err = suite.kgm.SplitKeyspaceGroupByID(1, 4, []uint32{444})
re.ErrorIs(err, ErrKeyspaceGroupNotEnoughReplicas)
// split the keyspace group 2 to 4 without giving any keyspace
err = suite.kgm.SplitKeyspaceGroupByID(2, 4, []uint32{})
Expand Down Expand Up @@ -319,7 +320,7 @@ func (suite *keyspaceGroupTestSuite) TestKeyspaceGroupSplit() {
err = suite.kgm.SplitKeyspaceGroupByID(3, 5, nil)
re.ErrorContains(err, ErrKeyspaceGroupNotExists(3).Error())
// split into an existing keyspace group
err = suite.kgm.SplitKeyspaceGroupByID(2, 4, nil)
err = suite.kgm.SplitKeyspaceGroupByID(2, 4, []uint32{111})
re.ErrorIs(err, ErrKeyspaceGroupExists)
// split with the wrong keyspaces.
err = suite.kgm.SplitKeyspaceGroupByID(2, 5, []uint32{111, 222, 444})
Expand Down

0 comments on commit 30cf388

Please sign in to comment.