Skip to content

Commit 11ec517

Browse files
committed
Start using xdist in pytest opts
We have `pytest-xdist` already installed, but we aren't using it. Set `-n auto --maxprocesses 8` in our config, so that it will be activated. The max prevents `-n auto` from starting large numbers of workers (e.g., 20) and losing any speed benefit to overheads. Using `-n auto` rather than (e.g., `-n 4`) ensures that in CI and other variable environments, we get the right number of workers. One test with a randomized parameter needed a tweak, as it made an xdist parameter consistency check fail.
1 parent ab0db21 commit 11ec517

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ attr = "globus_cli.version.__version__"
7575
profile = "black"
7676

7777
[tool.pytest.ini_options]
78-
addopts = "--timeout 3 --color=yes"
78+
addopts = "-n auto --maxprocesses 8 --timeout 3 --color=yes"
7979
filterwarnings = ["error"]
8080

8181
[tool.scriv]

tests/functional/gcs/endpoint/test_set_subscription_id.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from globus_sdk._testing import load_response_set
66

77

8-
@pytest.mark.parametrize("subscription_id", (str(uuid.uuid4()), "DEFAULT", "null"))
8+
@pytest.mark.parametrize(
9+
"subscription_id", (str(uuid.UUID(int=101)), "DEFAULT", "null")
10+
)
911
def test_gcs_endpoint_set_subscription_id(subscription_id, run_line, add_gcs_login):
1012
meta = load_response_set("cli.collection_operations").metadata
1113
endpoint_id = meta["endpoint_id"]

0 commit comments

Comments
 (0)