From 56e868ec636f4d8aae6aa4308d48c80715f8f9f3 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 17 Mar 2024 18:30:00 +0000 Subject: [PATCH 1/4] use --dist worksteal from latest xdist should reduce test time, especially when there are a high number of cores --- .github/workflows/test.yml | 1 + quicktest.sh | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb7a054a41..3da5d1f30f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,6 +124,7 @@ jobs: - name: Run tests run: | pytest \ + --dist worksteal \ -m "not fuzzing" \ --optimize ${{ matrix.opt-mode }} \ --evm-version ${{ matrix.evm-version }} \ 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 b0f7ef15f2..a1b4a33313 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ "pytest>=8.0,<9.0", "pytest-cov>=2.10,<3.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", From 439c65a91bd33bbbc3fb364cb954954ad8269e30 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 17 Mar 2024 15:58:15 -0400 Subject: [PATCH 2/4] use worksteal for fuzzing --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d692c136d..5a2686623d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -199,6 +199,7 @@ jobs: --splits 60 \ --group ${{ matrix.group }} \ --splitting-algorithm least_duration \ + --dist worksteal \ -r aR tests/ - name: Upload Coverage From 59382f6bc5432723bc9a4be66214072dbc83d0f4 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 17 Mar 2024 16:58:07 -0400 Subject: [PATCH 3/4] increase the number of jobs --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a2686623d..40a7db421c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -172,7 +172,7 @@ 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] + 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, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150] steps: - uses: actions/checkout@v4 @@ -196,7 +196,7 @@ jobs: run: | pytest \ -m "fuzzing" \ - --splits 60 \ + --splits 150 \ --group ${{ matrix.group }} \ --splitting-algorithm least_duration \ --dist worksteal \ From 092154274f5fa7aa4d44cc8b40efc827ec40d38e Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 17 Mar 2024 17:24:29 -0400 Subject: [PATCH 4/4] decrease number of jobs --- .github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40a7db421c..d1866ee18c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -172,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, 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, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150] + # 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 @@ -196,7 +199,7 @@ jobs: run: | pytest \ -m "fuzzing" \ - --splits 150 \ + --splits 120 \ --group ${{ matrix.group }} \ --splitting-algorithm least_duration \ --dist worksteal \