mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Merge pull request #10038 from charlesxsh/fix-TestReshardRaceWithStop
add proper exit for loop
This commit is contained in:
commit
dfa5cb7462
|
@ -356,6 +356,7 @@ func TestReshardRaceWithStop(t *testing.T) {
|
|||
|
||||
cfg := config.DefaultQueueConfig
|
||||
mcfg := config.DefaultMetadataConfig
|
||||
exitCh := make(chan struct{})
|
||||
go func() {
|
||||
for {
|
||||
metrics := newQueueManagerMetrics(nil, "", "")
|
||||
|
@ -364,6 +365,12 @@ func TestReshardRaceWithStop(t *testing.T) {
|
|||
h.Unlock()
|
||||
h.Lock()
|
||||
m.Stop()
|
||||
|
||||
select {
|
||||
case exitCh <- struct{}{}:
|
||||
return
|
||||
default:
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -372,6 +379,7 @@ func TestReshardRaceWithStop(t *testing.T) {
|
|||
m.reshardChan <- i
|
||||
h.Unlock()
|
||||
}
|
||||
<-exitCh
|
||||
}
|
||||
|
||||
func TestReleaseNoninternedString(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue