Skip to content

Commit

Permalink
make TestDefaultKeyspaceGroup stable
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Nov 24, 2023
1 parent eafc1ed commit 5a85b97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/integrations/mcs/keyspace/tso_keyspace_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ func (suite *keyspaceGroupTestSuite) TestDefaultKeyspaceGroup() {
return code == http.StatusOK && kg != nil
}, testutil.WithWaitFor(time.Second*1))
suite.Equal(utils.DefaultKeyspaceGroupID, kg.ID)
suite.Len(kg.Members, utils.DefaultKeyspaceGroupReplicaCount)
// the allocNodesToAllKeyspaceGroups loop will run every 100ms.
testutil.Eventually(suite.Require(), func() bool {
return len(kg.Members) == utils.DefaultKeyspaceGroupReplicaCount
})
for _, member := range kg.Members {
suite.Contains(nodes, member.Address)
}
Expand Down

0 comments on commit 5a85b97

Please sign in to comment.