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:
@ -39,6 +39,8 @@ type MemoryLeakTestSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *MemoryLeakTestSuite) SetupTest() {
|
func (s *MemoryLeakTestSuite) SetupTest() {
|
||||||
|
// Without this first line we observed some goroutines just closing.
|
||||||
|
runtime.Gosched()
|
||||||
s.ExpectedGoroutingIncrease = 0
|
s.ExpectedGoroutingIncrease = 0
|
||||||
s.goroutinesBefore = &bytes.Buffer{}
|
s.goroutinesBefore = &bytes.Buffer{}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user