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

Provide worker count env variable to processes #3231

Closed
nicojs opened this issue Oct 26, 2021 · 0 comments · Fixed by #3821
Closed

Provide worker count env variable to processes #3231

nicojs opened this issue Oct 26, 2021 · 0 comments · Fixed by #3821
Labels
🚀 Feature request New feature request hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@nicojs
Copy link
Member

nicojs commented Oct 26, 2021

Is your feature request related to a problem? Please describe.

When you're StrykerJS on a test suite that uses a resource (database connection, web server, file system, etc), you might want to be able to identify that you are running in a concurrent worker process and use that to choose a unique port, database, file, etc,

For example, when running StrykerJS on axios, a lot of mutants are falsely killed because all of the workers share port 4444

image

image

Describe the solution you'd like

Each worker should have a unique env variable called __STRYKER_MUTATOR_WORKER__. It should be assigned a unique number for that worker. So the first worker will get 0, second 1, etc

Describe alternatives you've considered

You can actually already misuse the active mutant for that, but I think a specific id for a worker is preferred here.

Additional context

@nicojs nicojs added 🚀 Feature request New feature request hacktoberfest https://hacktoberfest.digitalocean.com/ labels Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant