Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Jul 14, 2023
1 parent 403bd87 commit 9cc0371
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/integrations/mcs/tso/keyspace_group_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func waitFinishSplit(
splitSourceID, splitTargetID uint32,
splitSourceKeyspaces, splitTargetKeyspaces []uint32,
) {
var kg *endpoint.KeyspaceGroup
var kg endpoint.KeyspaceGroup
testutil.Eventually(re, func() bool {
code, data := handlersutil.TryLoadKeyspaceGroupByID(re, server, splitTargetID)
if code != http.StatusOK {
Expand Down
10 changes: 2 additions & 8 deletions tests/server/apiv2/handlers/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,8 @@ func tryCreateKeyspaceGroup(re *require.Assertions, server *tests.TestServer, re

// MustLoadKeyspaceGroupByID loads the keyspace group by ID with HTTP API.
func MustLoadKeyspaceGroupByID(re *require.Assertions, server *tests.TestServer, id uint32) *endpoint.KeyspaceGroup {
httpReq, err := http.NewRequest(http.MethodGet, server.GetAddr()+keyspaceGroupsPrefix+fmt.Sprintf("/%d", id), nil)
re.NoError(err)
resp, err := dialClient.Do(httpReq)
re.NoError(err)
defer resp.Body.Close()
data, err := io.ReadAll(resp.Body)
re.NoError(err)
re.Equal(http.StatusOK, resp.StatusCode, string(data))
code, data := TryLoadKeyspaceGroupByID(re, server, id)
re.Equal(http.StatusOK, code, string(data))
var kg endpoint.KeyspaceGroup
re.NoError(json.Unmarshal(data, &kg))
return &kg
Expand Down

0 comments on commit 9cc0371

Please sign in to comment.