Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
rleungx committed Jan 8, 2025
1 parent bf82504 commit cee26ed
Showing 3 changed files with 25 additions and 25 deletions.
24 changes: 12 additions & 12 deletions tests/integrations/mcs/tso/api_test.go
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ type tsoAPITestSuite struct {
suite.Suite
ctx context.Context
cancel context.CancelFunc
pdServiceCluster *tests.TestCluster
pdCluster *tests.TestCluster
tsoCluster *tests.TestTSOCluster
backendEndpoints string
}
@@ -62,13 +62,13 @@ func (suite *tsoAPITestSuite) SetupTest() {

var err error
suite.ctx, suite.cancel = context.WithCancel(context.Background())
suite.pdServiceCluster, err = tests.NewTestClusterWithKeyspace(suite.ctx, 1)
suite.pdCluster, err = tests.NewTestClusterWithKeyspace(suite.ctx, 1)
re.NoError(err)
err = suite.pdServiceCluster.RunInitialServers()
err = suite.pdCluster.RunInitialServers()
re.NoError(err)
leaderName := suite.pdServiceCluster.WaitLeader()
leaderName := suite.pdCluster.WaitLeader()
re.NotEmpty(leaderName)
pdLeaderServer := suite.pdServiceCluster.GetServer(leaderName)
pdLeaderServer := suite.pdCluster.GetServer(leaderName)
re.NoError(pdLeaderServer.BootstrapCluster())
suite.backendEndpoints = pdLeaderServer.GetAddr()
suite.tsoCluster, err = tests.NewTestTSOCluster(suite.ctx, 1, suite.backendEndpoints)
@@ -78,7 +78,7 @@ func (suite *tsoAPITestSuite) SetupTest() {
func (suite *tsoAPITestSuite) TearDownTest() {
suite.cancel()
suite.tsoCluster.Destroy()
suite.pdServiceCluster.Destroy()
suite.pdCluster.Destroy()
}

func (suite *tsoAPITestSuite) TestGetKeyspaceGroupMembers() {
@@ -137,12 +137,12 @@ func TestTSOServerStartFirst(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

pdServiceCluster, err := tests.NewTestClusterWithKeyspace(ctx, 1, func(conf *config.Config, _ string) {
pdCluster, err := tests.NewTestClusterWithKeyspace(ctx, 1, func(conf *config.Config, _ string) {
conf.Keyspace.PreAlloc = []string{"k1", "k2"}
})
defer pdServiceCluster.Destroy()
defer pdCluster.Destroy()
re.NoError(err)
addr := pdServiceCluster.GetConfig().GetClientURL()
addr := pdCluster.GetConfig().GetClientURL()
ch := make(chan struct{})
defer close(ch)
clusterCh := make(chan *tests.TestTSOCluster)
@@ -155,11 +155,11 @@ func TestTSOServerStartFirst(t *testing.T) {
clusterCh <- tsoCluster
ch <- struct{}{}
}()
err = pdServiceCluster.RunInitialServers()
err = pdCluster.RunInitialServers()
re.NoError(err)
leaderName := pdServiceCluster.WaitLeader()
leaderName := pdCluster.WaitLeader()
re.NotEmpty(leaderName)
pdLeaderServer := pdServiceCluster.GetServer(leaderName)
pdLeaderServer := pdCluster.GetServer(leaderName)
re.NoError(pdLeaderServer.BootstrapCluster())
re.NoError(err)
tsoCluster := <-clusterCh
14 changes: 7 additions & 7 deletions tests/integrations/mcs/tso/proxy_test.go
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ type tsoProxyTestSuite struct {
suite.Suite
ctx context.Context
cancel context.CancelFunc
pdServiceCluster *tests.TestCluster
pdCluster *tests.TestCluster
pdLeader *tests.TestServer
backendEndpoints string
tsoCluster *tests.TestTSOCluster
@@ -61,14 +61,14 @@ func (s *tsoProxyTestSuite) SetupSuite() {

var err error
s.ctx, s.cancel = context.WithCancel(context.Background())
// Create an PD service cluster with 1 server
s.pdServiceCluster, err = tests.NewTestCluster(s.ctx, 1)
// Create an PD cluster with 1 server
s.pdCluster, err = tests.NewTestCluster(s.ctx, 1)
re.NoError(err)
err = s.pdServiceCluster.RunInitialServers()
err = s.pdCluster.RunInitialServers()
re.NoError(err)
leaderName := s.pdServiceCluster.WaitLeader()
leaderName := s.pdCluster.WaitLeader()
re.NotEmpty(leaderName)
s.pdLeader = s.pdServiceCluster.GetServer(leaderName)
s.pdLeader = s.pdCluster.GetServer(leaderName)
s.backendEndpoints = s.pdLeader.GetAddr()
re.NoError(s.pdLeader.BootstrapCluster())

@@ -89,7 +89,7 @@ func (s *tsoProxyTestSuite) SetupSuite() {
func (s *tsoProxyTestSuite) TearDownSuite() {
cleanupGRPCStreams(s.cleanupFuncs)
s.tsoCluster.Destroy()
s.pdServiceCluster.Destroy()
s.pdCluster.Destroy()
s.cancel()
}

12 changes: 6 additions & 6 deletions tests/integrations/tso/client_test.go
Original file line number Diff line number Diff line change
@@ -544,13 +544,13 @@ func TestUpgradingAPIAndTSOClusters(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())

// Create an pd cluster which has 3 servers
pdServiceCluster, err := tests.NewTestCluster(ctx, 3)
pdCluster, err := tests.NewTestCluster(ctx, 3)
re.NoError(err)
err = pdServiceCluster.RunInitialServers()
err = pdCluster.RunInitialServers()
re.NoError(err)
leaderName := pdServiceCluster.WaitLeader()
leaderName := pdCluster.WaitLeader()
re.NotEmpty(leaderName)
pdLeader := pdServiceCluster.GetServer(leaderName)
pdLeader := pdCluster.GetServer(leaderName)
backendEndpoints := pdLeader.GetAddr()

// Create a pd client in PD mode to let the API leader to forward requests to the TSO cluster.
@@ -569,7 +569,7 @@ func TestUpgradingAPIAndTSOClusters(t *testing.T) {
mcs.WaitForTSOServiceAvailable(ctx, re, pdClient)

// Restart the PD service cluster
pdServiceCluster, err = tests.RestartTestPDCluster(ctx, pdServiceCluster)
pdCluster, err = tests.RestartTestPDCluster(ctx, pdCluster)
re.NoError(err)
// The TSO service should be eventually healthy
mcs.WaitForTSOServiceAvailable(ctx, re, pdClient)
@@ -581,7 +581,7 @@ func TestUpgradingAPIAndTSOClusters(t *testing.T) {
mcs.WaitForTSOServiceAvailable(ctx, re, pdClient)

tsoCluster.Destroy()
pdServiceCluster.Destroy()
pdCluster.Destroy()
cancel()
re.NoError(failpoint.Disable("github.com/tikv/pd/client/servicediscovery/usePDServiceMode"))
}

0 comments on commit cee26ed

Please sign in to comment.