Skip to content

Commit

Permalink
test: fix unstable test TestScheduler (#7074)
Browse files Browse the repository at this point in the history
close #7062

Signed-off-by: Cabinfever_B <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
CabinfeverB and ti-chi-bot[bot] committed Sep 11, 2023
1 parent d03f485 commit 68df4b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/pdctl/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/pingcap/kvproto/pkg/metapb"
"github.com/stretchr/testify/require"
"github.com/tikv/pd/pkg/core"
sc "github.com/tikv/pd/pkg/schedule/config"
"github.com/tikv/pd/pkg/utils/testutil"
"github.com/tikv/pd/pkg/versioninfo"
Expand Down Expand Up @@ -127,7 +128,8 @@ func TestScheduler(t *testing.T) {
pdctl.MustPutStore(re, leaderServer.GetServer(), store)
}

pdctl.MustPutRegion(re, cluster, 1, 1, []byte("a"), []byte("b"))
// note: because pdqsort is a unstable sort algorithm, set ApproximateSize for this region.
pdctl.MustPutRegion(re, cluster, 1, 1, []byte("a"), []byte("b"), core.SetApproximateSize(10))
time.Sleep(3 * time.Second)

// scheduler show command
Expand Down

0 comments on commit 68df4b6

Please sign in to comment.