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

An environment variable indicating the tox worker number in --parallel #3041

Closed
nedbat opened this issue Jun 17, 2023 · 3 comments
Closed

An environment variable indicating the tox worker number in --parallel #3041

nedbat opened this issue Jun 17, 2023 · 3 comments

Comments

@nedbat
Copy link
Contributor

nedbat commented Jun 17, 2023

What's the problem this feature will solve?

When using tox --parallel, coverage writes a number of data files and tries to combine them. But multiple processes are working in the same directory, creating a race condition. If we had an environment variable that distinguished among the parallel workers, we could name the data files differently and avoid collisions.

Here are reports of the problem:

Describe the solution you'd like

An environment variable called TOX_WORKER, a number for each worker, similar to pytest xdist's PYTEST_XDIST_WORKER.

@gaborbernat
Copy link
Member

We already inject the talks environment name as an environment variable, any reason why that will not suffice?

@nedbat
Copy link
Contributor Author

nedbat commented Jun 17, 2023

In this case, it looks like that will work. I think it could be useful to have the environment variable anyway.

@gaborbernat
Copy link
Member

tox environments are unordered so assigning numbers doesn't make sense, so for now I'll say no to such request. The name is a better identifier.

@gaborbernat gaborbernat closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants