Skip to content

Commit

Permalink
fix: Wait check node id goroutine in case of data race (milvus-io#36302)
Browse files Browse the repository at this point in the history
Resolves: milvus-io#36301

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Sep 19, 2024
1 parent e013ef1 commit c0317ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/integration/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"flag"
"os"
"strings"
"sync"
"time"

"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -104,8 +105,11 @@ func (s *MiniClusterSuite) SetupTest() {
s.Require().NoError(err)
s.Cluster = c

checkWg := sync.WaitGroup{}
checkWg.Add(1)
// start mini cluster
nodeIDCheckReport := func() {
defer checkWg.Done()
timeoutCtx, cancelFunc := context.WithTimeout(ctx, 5*time.Second)
defer cancelFunc()

Expand All @@ -124,6 +128,7 @@ func (s *MiniClusterSuite) SetupTest() {
}
go nodeIDCheckReport()
s.Require().NoError(s.Cluster.Start())
checkWg.Wait()
}

func (s *MiniClusterSuite) TearDownTest() {
Expand Down

0 comments on commit c0317ce

Please sign in to comment.