-
Notifications
You must be signed in to change notification settings - Fork 232
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
Question: Is it expected, that the tests run in the main thread? #469
Comments
Can you provide any more information to reproduce this? What version of xdist are you using? What options? |
That issue got introduced when execnet got thread models I believe, I suggest trying older versions of execnet |
I know the problem you are facing, occasionally a worker comes online with both MainThread and _DummyThread, I learned this the hard way using interrupting-cow, we just rolled our own slightly worse solution and everything works as normal |
I got the same problem. My tests are expected to be run in main thread. I'm exploring solution here. Would using |
@kimyen the issue is that modern execnet no longer guarantees that certain code runs in the main thread, and thus it creates a problem for such test |
@RonnyPfannschmidt , do you suggest any workaround for this problem? Or if there is a version of pytest-xdist that doesn't have this problem? Or which version of execnet has this problem? We do have any direct dependency on execnet, but maybe pytest-xdist should specifies a fix version to execnet. |
This looks the same as #620 which was opened later but has had more attention. Also see pytest-dev/execnet#96. |
I have some code that registers signals, basically starting it's own thread.
This needs to be in the main thread, since signals only work there. Once every, maybe, 30 executions in my CI an assert triggers, that my code (and thereby the test) was not executed on the main thread.
Is there a way to reliably make that happen? How come this is so rare? Could the CI and maybe hyperthreading have something to do with it?
The text was updated successfully, but these errors were encountered: