From 58ecff597e7e5f51e4d84c09daf9153195e07487 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 17 Mar 2024 17:58:53 -0400 Subject: [PATCH] chore[ci]: use `--dist worksteal` from latest `xdist` (#3869) should reduce test time, especially when there is a high degree of parallelism also increase the number of runners, as gh actions has increased limits lately --- .github/workflows/test.yml | 9 +++++++-- quicktest.sh | 2 +- setup.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c028fbd2cb..d1866ee18c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -137,6 +137,7 @@ jobs: - name: Run tests run: | pytest \ + --dist worksteal \ -m "not fuzzing" \ --optimize ${{ matrix.opt-mode }} \ --evm-version ${{ matrix.evm-version }} \ @@ -171,7 +172,10 @@ jobs: strategy: matrix: - group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60] + # note that every time this is updated, `--splits` needs to be + # updated below as well. + # python -c "print(list(range(1, 121)))" + group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120] steps: - uses: actions/checkout@v4 @@ -195,9 +199,10 @@ jobs: run: | pytest \ -m "fuzzing" \ - --splits 60 \ + --splits 120 \ --group ${{ matrix.group }} \ --splitting-algorithm least_duration \ + --dist worksteal \ -r aR tests/ - name: Upload Coverage diff --git a/quicktest.sh b/quicktest.sh index 8ecb322df9..cd2ee4d624 100755 --- a/quicktest.sh +++ b/quicktest.sh @@ -6,4 +6,4 @@ # run pytest but bail out on first error and suppress coverage. # useful for dev workflow -pytest -q --no-cov -s --instafail -x --disable-warnings "$@" +pytest --dist worksteal -q --no-cov -s --instafail -x --disable-warnings "$@" diff --git a/setup.py b/setup.py index b69f478326..becd73f7e3 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ "pytest>=8.0,<9.0", "pytest-cov>=4.1,<5.0", "pytest-instafail>=0.4,<1.0", - "pytest-xdist>=2.5,<3.0", + "pytest-xdist>=3.5,<4.0", "pytest-split>=0.7.0,<1.0", "eth-tester[py-evm]>=0.9.0b1,<0.10", "eth_abi>=4.0.0,<5.0.0",