mirror of https://github.com/milvus-io/milvus.git
fix: [skip e2e] [2.5]data race in load test (#39846)
Related to https://github.com/milvus-io/milvus/pull/39701 pr: #39845 Signed-off-by: Wei Liu <wei.liu@zilliz.com>pull/39966/head
parent
bf54f47c34
commit
d92ffb66a1
|
@ -21,6 +21,7 @@ import (
|
|||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -988,8 +989,11 @@ func (s *LoadTestSuite) TestLoadWithCompact() {
|
|||
s.releaseCollection(dbName, collName)
|
||||
|
||||
stopInsertCh := make(chan struct{}, 1)
|
||||
wg := &sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
// Start a goroutine to continuously insert data and trigger compaction
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for {
|
||||
select {
|
||||
case <-stopInsertCh:
|
||||
|
@ -1023,6 +1027,7 @@ func (s *LoadTestSuite) TestLoadWithCompact() {
|
|||
|
||||
// Clean up
|
||||
close(stopInsertCh)
|
||||
wg.Wait()
|
||||
s.releaseCollection(dbName, collName)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue