Skip to content
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

Enable configuring numprocesses's default tx command #1063

Open
puittenbroek opened this issue Apr 12, 2024 · 5 comments
Open

Enable configuring numprocesses's default tx command #1063

puittenbroek opened this issue Apr 12, 2024 · 5 comments

Comments

@puittenbroek
Copy link

Over the years I've used and introduced xdist whenever possibly to speed up pytest runs.

Usually just using the -n X notation was sufficient. But in our current application, we have to use the --tx notation to ensure we're using eventlet.

--tx '4*popen//execmodel=eventlet'

This is a lot to type if you 'just' want to speed up tests. And combining it with -n reverts it to just using popen.
Ideally I'd configuring it to default to using popen//execmodel=eventlet and then up the processes using -n X notation.

So my feature request would be:

Enable configuring what 'executing method' -n actually uses. With popen being the default.

So that in your pytest.ini you can do something like this:

[pytest]
addopts = --default-tx popen//execmodel=eventlet

And then can add more worker as desired with the -n notation.

@RonnyPfannschmidt
Copy link
Member

Initially tx was primarily for remote hosts, there's no safe way to know the correct n

Would a setting for the default args help

@puittenbroek
Copy link
Author

Initially tx was primarily for remote hosts, there's no safe way to know the correct n

Would a setting for the default args help

Depends a little bit what you mean with the default args :)

@RonnyPfannschmidt
Copy link
Member

default arg as in the tx used when using -n

@RonnyPfannschmidt
Copy link
Member

also heads up - there are considerations for removing gevent/eventlet support from execnet as their implementation in execnet is actively hostile to supporting asyncio as of now

@puittenbroek
Copy link
Author

puittenbroek commented Apr 16, 2024

default arg as in the tx used when using -n

Yes that was exactly my intention! :)

also heads up - there are considerations for removing gevent/eventlet support from execnet as their implementation in execnet is actively hostile to supporting asyncio as of now

Hmm that is good to know. We're using nameko which uses eventlet under the mood. So using this tx helps us run everything in one session. But that would mean we'd need to split it up again :/ We'll see how to handle that once we get there :)

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

No branches or pull requests

2 participants