-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fixes signal that only works in main thread of the main interpreter #133
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
+ Coverage 90.07% 90.31% +0.23%
==========================================
Files 5 5
Lines 635 640 +5
==========================================
+ Hits 572 578 +6
+ Misses 63 62 -1 ☔ View full report in Codecov by Sentry. |
Sorry it's taken me an insane amount of time to actually look at this. Looking at the warning output of the the CI builds: https://github.com/Cadair/parfive/actions/runs/6156492456/job/16705281425?pr=133#step:10:360 We should test that the warning is raised using Also there's some annoying error where shutting down the event loop in a thread raises an error, but I am not sure if that's our error or not. |
Co-authored-by: Stuart Mumford <stuart@cadair.com>
Hi again and thank you for looking at this! As you suggested I will add a check on the test that the warning is raised. I will use pytest.warns so I do my reading now and I will push this soon. I have also explored the warnings of the tests further. These are ~related to the same I started from a previous version to make some tests (this commit ae5f6bc, just before my version). The warning I get from pytest is
The |
Adds a test that a warning is raised when download has been started in a thread which is not the main thread.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Stuart Mumford <stuart@cadair.com>
Adds a test that a warning is raised when download has been started in a thread which is not the main thread.
for more information, see https://pre-commit.ci
😭 Why does Python 3.8 hate us lol I think this is pretty much good to go if we can make the py3.8 build happy. |
I do not think this fail is py38 dependent. The CI test passed on py38 ubuntu but failed on windows, so I think it is os dependent. According to the error,
no warning is emitted when runing the test on windows-latest, as if the condition Any suggestions? |
The test_download_out_of_main_thread fails for windows and this is normal because the UserWarning is never emitted because initially the _add_shutdown_signals is skipped for windows. So this commit fix this issue.
Hi @Cadair I think now I understand better what is happening with the issue. As I previously mentioned the
|
hmm, it seems that the test this PR added is flakey on macos, i.e. sometimes it passes and sometimes it fails. |
Signal only works in main thread of the main interpreter so this commit