Skip to content

Commit 3811b9c

Browse files
amirafzalifacebook-github-bot
authored andcommitted
subprocess and parallelize py tests (#241)
Summary: Pull Request resolved: #241 - pytest-xdist will spin up a number of processes equal to CPU count and parallelizes the tests for a nice speed increase. it should also create some isolation (previously they all shared a single process context which increases the likelihood of state leaks) - let's monitor this and make sure it doesn't spin up hard to debug failures - also setting a default timeout of 300s. don't think anything should ever take more than 5m... Reviewed By: suo Differential Revision: D76448556 fbshipit-source-id: a0829fb242bad72bf3ae55fe1daec6f6a1332e88
1 parent 42a123a commit 3811b9c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ jobs:
6464
pip install --no-build-isolation .
6565
6666
# Run tests
67-
LC_ALL=C pytest python/tests/ -s -v -m "not oss_skip"
67+
LC_ALL=C pytest python/tests/ -s -v -m "not oss_skip" -n auto
6868
python python/tests/test_mock_cuda.py

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ markers = [
44
"oss_skip: marks tests to skip in OSS CI",
55
]
66
asyncio_mode = "auto"
7+
# Default timeout of 5 minutes
8+
timeout = 300

python/tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
pytest-timeout
33
pytest-asyncio
4+
pytest-xdist

0 commit comments

Comments
 (0)