Handle stopping goroutines of the MemoryLeakTestSuite.

We observed a race condition that sometimes goroutines are just closing but still measured by the goroutine Lookup of the following test.
We try to avoid this by adding `runtime.Gosched()` at the start of each test.
This commit is contained in:
Maximilian Paß
2023-11-15 00:02:36 +01:00
parent 2ea24911de
commit 41eb2627ae

View File

@ -39,6 +39,8 @@ type MemoryLeakTestSuite struct {
}
func (s *MemoryLeakTestSuite) SetupTest() {
// Without this first line we observed some goroutines just closing.
runtime.Gosched()
s.ExpectedGoroutingIncrease = 0
s.goroutinesBefore = &bytes.Buffer{}