Skip to content
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

Test for goroutine leaks #342

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

msabramo
Copy link
Contributor

@msabramo msabramo commented May 30, 2018

Add goroutine leak testing to tests to probe for goroutine leakage, as mentioned in #208

In particular:

=== RUN   TestSSEWithManyListeners
--- FAIL: TestSSEWithManyListeners (5.05s)
	leaktest.go:129: leaktest: timed out checking goroutines
	leaktest.go:147: leaktest: leaked goroutine: goroutine 750 [chan receive]:
		github.com/gambol99/go-marathon.(*marathonClient).registerSSESubscription.func1(0xc4203a41e0)
			/home/travis/gopath/src/github.com/gambol99/go-marathon/subscription.go:186 +0x130
		created by github.com/gambol99/go-marathon.(*marathonClient).registerSSESubscription
			/home/travis/gopath/src/github.com/gambol99/go-marathon/subscription.go:181 +0x1a6
	leaktest.go:147: leaktest: leaked goroutine: goroutine 772 [chan receive]:
		github.com/gambol99/go-marathon.(*cluster).healthCheckNode(0xc4200a09c0, 0xc4202c23a0)
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:139 +0xee
		created by github.com/gambol99/go-marathon.(*cluster).markDown
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:128 +0x186
	leaktest.go:147: leaktest: leaked goroutine: goroutine 774 [chan receive]:
		github.com/gambol99/go-marathon.(*cluster).healthCheckNode(0xc4200a09c0, 0xc4202c23c0)
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:139 +0xee
		created by github.com/gambol99/go-marathon.(*cluster).markDown
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:128 +0x186
	leaktest.go:147: leaktest: leaked goroutine: goroutine 777 [chan receive]:
		github.com/gambol99/go-marathon.(*cluster).healthCheckNode(0xc4200a09c0, 0xc4202c23e0)
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:139 +0xee
		created by github.com/gambol99/go-marathon.(*cluster).markDown
			/home/travis/gopath/src/github.com/gambol99/go-marathon/cluster.go:128 +0x186

illustrates that the number of goroutines will increase if the listeners are not doing their job of consuming events and don't deregister.

Cc: @seanisom, @mayanand, @kmillett

Add goroutine leak testing to tests to probe for goroutine leakage, as
mentioned in gambol99#208
@mayanand
Copy link

CC: @timoreimann @gambol99 @sybrandy @iandyh @marco-jantke

@iandyh
Copy link
Contributor

iandyh commented Jun 3, 2018

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants