-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Don't attempt to register signals in non-main thread #11548
Conversation
✅ Deploy Preview for prefect-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@serinamarie hmm - what do you think will happen when the tests that previously failed with |
Tests that previously intermittently failed on this error would not fail on the error and the tests would still run. It's just that the signal wouldn't be registered in those cases. It doesn't seem to have affected the ability of the tests to run/pass.
I don't think it's necessarily erroneous, just that the tests themselves are sometimes run off the main thread and it's an underlying issue with pytest. |
@abrookins I think there's more to do here but the errors are becoming more prevalent so this is my attempt to get something across the line. But wondering if you have thoughts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it. Whatever the reason we might get here and try to register a signal handler off the main thread, pytest-related or otherwise, it's not going to work, so we may as well prevent it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we've never observed this error anywhere but tests, or had any users report encountering it, it makes sense to me that we'd just quietly skip this.
This helps address #10895
The flaky tests on main leading to:
ValueError: signal only works in main thread of the main interpreter
are getting out of hand. This PR attempts to fix that by only attempting to registering signal on main thread.Checklist
<link to issue>
"fix
,feature
,enhancement
,docs
.For documentation changes:
netlify.toml
for files that are removed or renamed