Skip to content

Commit bfd9e8a

Browse files
authored
test: wait for statistics owner to close on exit (#62198)
close #62197
1 parent 1a3bb65 commit bfd9e8a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/domain/domain.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,13 @@ func (do *Domain) gcStatsWorkerExitPreprocessing() {
21132113
do.statsOwner.Close()
21142114
ch <- struct{}{}
21152115
}()
2116+
if intest.InTest {
2117+
// We should wait for statistics owner to close on exit.
2118+
// Otherwise, the goroutine leak detection may fail.
2119+
<-ch
2120+
logutil.BgLogger().Info("gcStatsWorker exit preprocessing finished")
2121+
return
2122+
}
21162123
select {
21172124
case <-ch:
21182125
logutil.BgLogger().Info("gcStatsWorker exit preprocessing finished")

0 commit comments

Comments
 (0)