Controller-runtime: Test that we don't leak goroutines on start and stop

Created on 10 Dec 2019  路  6Comments  路  Source: kubernetes-sigs/controller-runtime

We should have tests for simple operations that make sure they don't leak goroutines. Namely, manager.Start & stop and controller.New, both of which leaked in the past.

We can use the runtime package to get the goroutine count.

/good-first-issue

good first issue help wanted

All 6 comments

@DirectXMan12:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

We should have tests for simple operations that make sure they don't leak goroutines. Namely, manager.Start & stop and controller.New, both of which leaked in the past.

We can use the runtime package to get the goroutine count.

/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Any ideas on how to filter only the goroutines from manager/controller?

Using the NumGoroutines directly in the test case returns all (including from test suite, its around ~43), do makes sense to iterate on this list and extract by file path maybe?

Any ideas on how to filter only the goroutines from manager/controller?

Maybe by counting them before starting & stopping the manager or a controller, then checking if the count is back at where it was initially?

Is there anything else to be done here? The PR is merged so I believe the issue can be closed.

Closing given that #738 has been merged

/close

@vincepri: Closing this issue.

In response to this:

Closing given that #738 has been merged

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings