Feature request: Process ID (count) added as an environment variable #2142
Closed
sondrelg
started this conversation in
Feature requests
Replies: 1 comment 5 replies
-
Thanks -- this is an interesting idea. So in effect, set a number that increases from 1 and is unique for the duration the test is running. I think one challenge here is that you can configure the number of slots for a test, setting it anywhere from 0 to the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
I would like to be able to run tests concurrently across multiple Redis databases.
While nextest allows me to run tests concurrently, I'm constrained to a single process by the fact that I have a shared storage layer with global queues, making it hard to isolate tests unless I run on separate databases.
Proposal
Add a
NEXTEST_PROCESS_ID
which would count 1, 2, 3, 4 for each process spawned.This way I'd be able to deterministically do this in the app:
Alternatives
No response
Additional context
As an example,
pytest-xdist
from the python ecosystem does something similar: https://pytest-xdist.readthedocs.io/en/stable/how-to.html#envvar-PYTEST_XDIST_WORKERThey call their environment variables:
PYTEST_XDIST_WORKER
(current value)PYTEST_XDIST_WORKER_COUNT
(total value)Beta Was this translation helpful? Give feedback.
All reactions