Skip to content

Commit

Permalink
cluster: make TestStoreOverloadedWithReplace stable (#8068)
Browse files Browse the repository at this point in the history
ref #7969

Signed-off-by: husharp <jinhao.hu@pingcap.com>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
HuSharp and ti-chi-bot[bot] authored Apr 15, 2024
1 parent 0214778 commit a109f9c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3480,10 +3480,11 @@ func TestStoreOverloadedWithReplace(t *testing.T) {
re.False(oc.AddOperator(op3))
ops, _ := lb.Schedule(tc, false /* dryRun */)
re.Empty(ops)
// sleep 2 seconds to make sure that token is filled up
time.Sleep(2 * time.Second)
ops, _ = lb.Schedule(tc, false /* dryRun */)
re.NotEmpty(ops)
// make sure that token is filled up
testutil.Eventually(re, func() bool {
ops, _ = lb.Schedule(tc, false /* dryRun */)
return len(ops) != 0
})
}

func TestDownStoreLimit(t *testing.T) {
Expand Down

0 comments on commit a109f9c

Please sign in to comment.