-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use goleak to autodetect leaks #2128
Conversation
8918225
to
debdabb
Compare
👍 |
Did it discover any leaks actually? |
Yes it does. I was also not able to fix all cases, for example go-redis heartbeat. |
We should definitely include leak fixes! There is no easy way to fix uber-go/goleak#83 as There is also an older lib https://github.com/fortytw2/leaktest that looks at the diff between goroutine snapshots before test start and after test ends.
Both libraries provide per-test checks (
I think we should use PS: I was curious how it works and to understand re-implemented it here https://github.com/AlexanderYastrebov/noleak |
8e16270
to
719270d
Compare
test that redistest does not leak goroutines fix: found goroutine leaks fix: wrap close in sync.once.Do fix: shallow copy can not copy by deref ptr in case it contains sync.Once refactor: *sync-Once to sync.Once as shown in stdlib Go example fix as commented: cleanup nil check fix as commented: remove t.closed in httpclient test: add test that NewClient will never return nil fix as commented: remove time.Sleep fix as commented: use embedding to get rid of delegations Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
…very tick run Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
add todo to refactor receiveFromClient to use ticker instead of time.After Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
diag_test.go:907: p25 not in range want p25=9ms with epsilon=1ms, got: 7.876215ms diag_test.go:986: p25 not in range want p25=9ms with epsilon=1ms, got: 7.908821ms Signed-off-by: Sandor Szücs <[email protected]>
…eneral Signed-off-by: Sandor Szücs <[email protected]>
…rror in creating the dataclient Signed-off-by: Sandor Szücs <[email protected]>
… leak checkers Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Alexander Yastrebov <[email protected]>
👍 |
1 similar comment
👍 |
replaces #2051 by using https://github.com/AlexanderYastrebov/noleak
One problem I see is uber-go/goleak#83 , so not sure if we want to merge this or better add only fixes for findings and drop the use of goleak. What do you think?
We agreed on that we use only package based tests and I decided to give https://github.com/AlexanderYastrebov/noleak a try since it's simpler than goleak and Uber engineers seem not to be responsive in this project.
Signed-off-by: Sandor Szücs [email protected]