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

Unit tests leaking thread pools #566

Closed
amoralej opened this issue Jul 11, 2018 · 7 comments
Closed

Unit tests leaking thread pools #566

amoralej opened this issue Jul 11, 2018 · 7 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. help-needed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@amoralej
Copy link

Unit tests in kubernetes python client don't terminate the pools in tearDown. This makes them to fail when running in specific environments with lower limits as 32bit systems, with errors like:

error: can't start new thread

I've tested it adding pools termination in unit tests and it worked fine, however i understand unit tests are generated automatically with swagger, so i'm not sure what's the right way to propose patches here.

@roycaihw roycaihw self-assigned this Jul 12, 2018
@zhusichuang
Copy link

zhusichuang commented Jul 18, 2018

I have the same issue.

api = core_v1_api.CoreV1Api()
resp = stream(api.connect_get_namespaced_pod_exec, name, 'default',
              command=exec_command,
              stderr=True, stdin=False,
              stdout=True, tty=False)
api = None

The first line code will produce about 59 threads, but after I call the exec api and make the api variable be None ,the 59 threads still be alive in my process.

@amoralej
Copy link
Author

I think the right fix is add api _client pools terminate in tearDown for each test.

@roycaihw
Copy link
Member

This is a known issue. Please see #411. @amoralej The tests are generated using swagger-codegen: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/python/api_test.mustache, please feel free to patch the upstream generator.

@roycaihw roycaihw removed their assignment Jul 23, 2018
@roycaihw roycaihw added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Oct 30, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 26, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 26, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. help-needed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants