Skip to content

Terminate threads to avoid test interactions - #244

Merged
tchaton merged 2 commits into
mainfrom
tests/threads
Jul 19, 2024
Merged

Terminate threads to avoid test interactions#244
tchaton merged 2 commits into
mainfrom
tests/threads

Conversation

@awaelchli

@awaelchli awaelchli commented Jul 19, 2024

Copy link
Copy Markdown
Contributor

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
@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