Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tso: fix the corner case that may cause TSO fallback (#4885) #4894

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the test
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed May 9, 2022
commit 119f3a2cebd5d58bd52aaadd9bb33f29a1334d9f
8 changes: 4 additions & 4 deletions tests/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ func (s *clientTestSuite) TestUpdateAfterResetTSO(c *C) {
defer cluster.Destroy()

endpoints := s.runServer(c, cluster)
cli := setupCli(c, s.ctx, endpoints)
cli := s.setupCli(c, endpoints, false)

testutil.WaitUntil(c, func() bool {
testutil.WaitUntil(c, func(c *C) bool {
_, _, err := cli.GetTS(context.TODO())
return err == nil
})
Expand All @@ -204,7 +204,7 @@ func (s *clientTestSuite) TestUpdateAfterResetTSO(c *C) {
newLeaderName := cluster.WaitLeader()
c.Assert(newLeaderName, Not(Equals), oldLeaderName)
// Request a new TSO.
testutil.WaitUntil(c, func() bool {
testutil.WaitUntil(c, func(c *C) bool {
_, _, err := cli.GetTS(context.TODO())
return err == nil
})
Expand All @@ -213,7 +213,7 @@ func (s *clientTestSuite) TestUpdateAfterResetTSO(c *C) {
err = cluster.GetServer(newLeaderName).ResignLeader()
c.Assert(err, IsNil)
// Should NOT panic here.
testutil.WaitUntil(c, func() bool {
testutil.WaitUntil(c, func(c *C) bool {
_, _, err := cli.GetTS(context.TODO())
return err == nil
})
Expand Down