-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use goleak to autodetect leaks (#2128)
* test: use goleak to autodetect leaks 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]> * refactor: remove uber crap and use reimplemantation Signed-off-by: Sandor Szücs <[email protected]> * replace time.After with Ticker Signed-off-by: Sandor Szücs <[email protected]> * fix: time.After leak by refactor extract method to runFirst and for every tick run Signed-off-by: Sandor Szücs <[email protected]> * fix: for select time.After leaks Signed-off-by: Sandor Szücs <[email protected]> * remove nil check fo transport add todo to refactor receiveFromClient to use ticker instead of time.After Signed-off-by: Sandor Szücs <[email protected]> * fix time.After leak in receiveFromClient Signed-off-by: Sandor Szücs <[email protected]> * fix: panic: non-positive interval for NewTicker Signed-off-by: Sandor Szücs <[email protected]> * change test results 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]> * refactor: use continue instead of to=0, which seems a better fit in general Signed-off-by: Sandor Szücs <[email protected]> * fix as commented: make sure that the type is enforced if we have no error in creating the dataclient Signed-off-by: Sandor Szücs <[email protected]> * update noleak to have the same timeout setting as all other goroutine leak checkers Signed-off-by: Sandor Szücs <[email protected]> * Removes redundant nil check Signed-off-by: Alexander Yastrebov <[email protected]> Signed-off-by: Sandor Szücs <[email protected]> Signed-off-by: Alexander Yastrebov <[email protected]> Co-authored-by: Alexander Yastrebov <[email protected]>
- Loading branch information
1 parent
cbc8789
commit 94faee3
Showing
27 changed files
with
246 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package kubernetes_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/AlexanderYastrebov/noleak" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
os.Exit(noleak.CheckMain(m)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package eskip_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/AlexanderYastrebov/noleak" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
os.Exit(noleak.CheckMain(m)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/AlexanderYastrebov/noleak" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
os.Exit(noleak.CheckMain(m)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.