Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Aug 21, 2024
1 parent 022161a commit 6c98636
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/tso_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ tsoBatchLoop:
}
// Because ScheduleCheckMemberChanged is asynchronous, if the leader changes, we better call `updateMember` ASAP.
if errs.IsLeaderChange(err) {
svcDiscovery.ScheduleCheckServiceModeChanged()
if err := bo.Exec(ctx, svcDiscovery.CheckMemberChanged); err != nil {
select {
case <-ctx.Done():
Expand Down
6 changes: 5 additions & 1 deletion tests/integrations/mcs/tso/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,16 @@ func TestResignAPIPrimaryForward(t *testing.T) {
defer func() {
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck"))
}()
pdClient, err := pd.NewClientWithContext(context.Background(),
[]string{suite.backendEndpoints}, pd.SecurityOption{}, pd.WithMaxErrorRetry(1))
re.NoError(err)
defer pdClient.Close()

for j := 0; j < 10; j++ {
suite.pdLeader.ResignLeader()
suite.pdLeader = suite.cluster.GetServer(suite.cluster.WaitLeader())
suite.backendEndpoints = suite.pdLeader.GetAddr()
_, _, err = suite.pdClient.GetTS(suite.ctx)
_, _, err = pdClient.GetTS(suite.ctx)
re.NoError(err)
}
}
Expand Down

0 comments on commit 6c98636

Please sign in to comment.