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
wei liu 2025-02-18 15:04:50 +08:00 committed by GitHub
parent bf54f47c34
commit d92ffb66a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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)
}