Skip to content

Terminate threads to avoid test interactions #244

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

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Terminate threads to avoid test interactions #244

merged 2 commits into from
Jul 19, 2024

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Jul 19, 2024

This adds a fixture that runs on each test, monitoring whether the test left threads behind. This logic is adapted from PyTorch Lightning. Avoids test interactions from threading, and will raise error if new tests added in the future will leave threads behind.

This doesn't solve the issues with optimize() I've seen in #237, but it should still be a helpful as a sanity check.

@awaelchli awaelchli marked this pull request as ready for review July 19, 2024 18:07
@awaelchli awaelchli requested a review from tchaton as a code owner July 19, 2024 18:07
@tchaton tchaton merged commit fd411e5 into main Jul 19, 2024
31 of 32 checks passed
@tchaton tchaton deleted the tests/threads branch July 19, 2024 19:11
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.

2 participants