Skip to content

Commit

Permalink
make TestServerRegister 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 Apr 18, 2023
1 parent e75eef1 commit 0069252
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/integrations/mcs/discovery/register_test.go
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"strconv"
"testing"
"time"

"github.com/stretchr/testify/suite"
bs "github.com/tikv/pd/pkg/basicserver"
Expand Down Expand Up @@ -106,6 +107,9 @@ func (suite *serverRegisterTestSuite) checkServerRegister(serviceName string) {
endpoints, err = discovery.Discover(client, suite.clusterID, serviceName)
re.NoError(err)
re.Empty(endpoints)
testutil.Eventually(re, func() bool {
return !s.IsServing()
}, testutil.WithWaitFor(3*time.Second), testutil.WithTickInterval(50*time.Millisecond))
}

func (suite *serverRegisterTestSuite) TestServerPrimaryChange() {
Expand Down

0 comments on commit 0069252

Please sign in to comment.