Skip to content

Commit

Permalink
augment the hakeeperDefaultTimeout in ut to avoid `TestHAKeeperCanB…
Browse files Browse the repository at this point in the history
…ootstrapAndRepairShards` failed (#14252)

augment the `hakeeperDefaultTimeout` to avoid `TestHAKeeperCanBootstrapAndRepairShards` failed.

this change only happened when UT.

cherry-pick to 1.1: #14253

Approved by: @zhangxu19830126
  • Loading branch information
gouhongshen committed Jan 17, 2024
1 parent 240f086 commit c582b7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/logservice/store_hakeeper_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ import (
)

const (
minIDAllocCapacity uint64 = 1024
defaultIDBatchSize uint64 = 1024 * 10
minIDAllocCapacity uint64 = 1024
defaultIDBatchSize uint64 = 1024 * 10
checkBootstrapCycles = 100
)

var (
hakeeperDefaultTimeout = 2 * time.Second
checkBootstrapCycles = 100
)

type idAllocator struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/logservice/store_hakeeper_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ func TestHAKeeperCanBootstrapAndRepairShards(t *testing.T) {
fn := func(t *testing.T, services []*Service) {
// bootstrap the cluster, 1 TN 1 Log shard, Log and HAKeeper have
// 3 replicas
hakeeperDefaultTimeout = 10 * time.Second

store1 := services[0].store
state, err := store1.getCheckerState()
require.NoError(t, err)
Expand Down

0 comments on commit c582b7d

Please sign in to comment.