Commit Graph

6 Commits

Author SHA1 Message Date
Maximilian Paß
ab938bfc22 Refactor MemoryLeakTestSuite
as we identified two issues where the goroutine count from before differs from after the test.

1) It seemed like a Go runtime specific Goroutine appeared in rare cases before the test. To avoid this, we introduced a short timeout before looking up the Goroutines.
Another solution might be to do the lookup twice and check if the count matches.

2) A Goroutine that periodically monitors some storage unexpectedly got closed in rare cases. As we could not identify the cause for this, we removed the leaking Goroutines by properly cleaning up.
2024-02-28 11:52:51 +01:00
Maximilian Paß
41eb2627ae 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.
2023-11-16 12:10:57 +01:00
Maximilian Paß
2ea24911de Fix inconsistent calculation of goroutines.
We observed that sometimes the `pprof.Lookup("goroutine")` resulted in a different goroutine count than `runtime.NumGoroutine()`. It might be due to a race condition, but our usage of both made it impossible to debug.
2023-11-16 12:10:57 +01:00
Maximilian Paß
3abd4d9a3d Refactor all tests to use the MemoryLeakTestSuite. 2023-09-11 13:44:29 +02:00
Maximilian Paß
a01bd0fa7e Provide Memory Leak Test Suite
by adding an assertion about the number of Goroutines to the unit tests.
2023-09-11 13:44:29 +02:00
Konrad Hanff
c7ed54942d Move ChannelReceivesSomething to tests package.
ChannelReceivesSomething (formerly WaitForChannel) originally was
located in the helpers package.
This move was done to remove a cyclic dependency with the nomand package.
2021-06-21 10:54:07 +02:00