From d0ce260021dd3758554927c60f562fbb09b49cf1 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 15:07:10 -0300 Subject: [PATCH 1/8] partition slow test --- .github/workflows/slowtest.yaml | 77 ++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 4eeb90f14e..9199fe24c4 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -23,34 +23,81 @@ env: RUST_LOG: info,libp2p=off,node=error jobs: + build-test-artifacts: + name: Build test artifacts + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - uses: rui314/setup-mold@v1 + + - uses: actions/checkout@v4 + + - name: Install nextest + uses: taiki-e/install-action@nextest + + - name: Enable Rust Caching + uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + cache-provider: buildjet + + - name: Build and archive tests + run: cargo nextest archive --locked --workspace --all-features --archive-file nextest-archive.tar.zst + + - name: Upload archive to workflow + uses: actions/upload-artifact@v4 + with: + name: nextest-archive + path: nextest-archive.tar.zst + + build-diff-test: + name: Build test artifacts + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - uses: rui314/setup-mold@v1 + + - uses: actions/checkout@v4 + + - name: Install nextest + uses: taiki-e/install-action@nextest + + - name: Enable Rust Caching + uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + cache-provider: buildjet + + - name: Build and archive tests + run: cargo nextest archive --locked --workspace --all-features --archive-file nextest-archive.tar.zst + + - name: Upload archive to workflow + uses: actions/upload-artifact@v4 + with: + name: nextest-archive + path: nextest-archive.tar.zst + slow-tests: + needs: [build-diff-test, build-test-artifacts] runs-on: ubuntu-latest + strategy: + matrix: + partition: [1, 2] steps: # These tests need the `anvil` binary provided by foundry - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - - uses: taiki-e/install-action@nextest - - name: Checkout Repository uses: actions/checkout@v4 - - name: Configure Environment - run: PATH="$PWD/target/release:$PATH" - - - name: Enable Rust Caching - uses: Swatinem/rust-cache@v2 + - name: Download archive + uses: actions/download-artifact@v4 with: - cache-all-crates: true - - - name: Build - run: | - cargo build --locked --bin diff-test --release - cargo nextest run --locked --release --workspace --all-features --no-run - timeout-minutes: 90 + name: nextest-archive - name: Slow Test env: NEXTEST_PROFILE: slow - run: cargo nextest run --locked --release --workspace --all-features --verbose --no-fail-fast --nocapture + run: | + cargo nextest run --archive-file nextest-archive.tar.zst --verbose --no-fail-fast --nocapture \ + --workspace-remap $PWD --partition count:${{ matrix.partition }}/2 timeout-minutes: 40 From 8824a09752a5400e7f55fb1d88e5dd458135872c Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 15:09:36 -0300 Subject: [PATCH 2/8] fix name --- .github/workflows/slowtest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 9199fe24c4..6d3fdc4ca5 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -50,7 +50,7 @@ jobs: path: nextest-archive.tar.zst build-diff-test: - name: Build test artifacts + name: Build Diff Test runs-on: buildjet-8vcpu-ubuntu-2204 steps: - uses: rui314/setup-mold@v1 From 46df30b61398437cdd1b682900b416ca055de502 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 15:24:18 -0300 Subject: [PATCH 3/8] fix name of archive also copy in the bins and such --- .github/workflows/slowtest.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 6d3fdc4ca5..ae392c5b5c 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -72,8 +72,8 @@ jobs: - name: Upload archive to workflow uses: actions/upload-artifact@v4 with: - name: nextest-archive - path: nextest-archive.tar.zst + name: diff-test + path: target/release/diff-test slow-tests: needs: [build-diff-test, build-test-artifacts] @@ -91,8 +91,16 @@ jobs: - name: Download archive uses: actions/download-artifact@v4 - with: - name: nextest-archive + + - name: Move files + run: | + mv nextest-archive/* . + mkdir -p target/release + mv diff-test/* target/release + chmod -c +x target/release/* + + - name: Configure Environment + run: PATH="$PWD/target/release:$PATH" - name: Slow Test env: From 2965c3c988dbde7b652bb5998e1c792ea0c9a2fc Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 15:38:51 -0300 Subject: [PATCH 4/8] fix build cmd --- .github/workflows/slowtest.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index ae392c5b5c..b9df7fb757 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -54,12 +54,8 @@ jobs: runs-on: buildjet-8vcpu-ubuntu-2204 steps: - uses: rui314/setup-mold@v1 - - uses: actions/checkout@v4 - - name: Install nextest - uses: taiki-e/install-action@nextest - - name: Enable Rust Caching uses: Swatinem/rust-cache@v2 with: @@ -67,7 +63,7 @@ jobs: cache-provider: buildjet - name: Build and archive tests - run: cargo nextest archive --locked --workspace --all-features --archive-file nextest-archive.tar.zst + run: cargo build --locked --bin diff-test --release - name: Upload archive to workflow uses: actions/upload-artifact@v4 From e3b6488ff388a88b0556004da82f4a15f867084f Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 16:06:49 -0300 Subject: [PATCH 5/8] add nextest --- .github/workflows/slowtest.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index b9df7fb757..b472356e1b 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -56,6 +56,9 @@ jobs: - uses: rui314/setup-mold@v1 - uses: actions/checkout@v4 + - name: Install nextest + uses: taiki-e/install-action@nextest + - name: Enable Rust Caching uses: Swatinem/rust-cache@v2 with: From 4bc0b6908e893af5c8d5214d2d75aec648569f03 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 16:33:34 -0300 Subject: [PATCH 6/8] install nextest in the right place --- .github/workflows/slowtest.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index b472356e1b..2ed0d2f34d 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -56,8 +56,6 @@ jobs: - uses: rui314/setup-mold@v1 - uses: actions/checkout@v4 - - name: Install nextest - uses: taiki-e/install-action@nextest - name: Enable Rust Caching uses: Swatinem/rust-cache@v2 @@ -85,6 +83,9 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 + - name: Install nextest + uses: taiki-e/install-action@nextest + - name: Checkout Repository uses: actions/checkout@v4 From 91f963972ccd47261915a746820532142699fc79 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 16:55:05 -0300 Subject: [PATCH 7/8] slow-test termination period --- .config/nextest.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index af8b6a75a0..cd475651c4 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -9,9 +9,10 @@ filter = 'test(slow_test_restart)' threads-required = 'num-cpus' [profile.slow] -slow-timeout = "2m" +slow-timeout.period = "2m" +slow-timeout.terminate-after = 2 # terminate test after 2 * 2 = 4 mins default-filter = 'test(slow_)' -retries = 2 +retries = 3 [profile.all] slow-timeout = "2m" From 0c7f44aa185d7f3e190371b4b1c26835fc8d074a Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 27 Nov 2024 17:28:06 -0300 Subject: [PATCH 8/8] try move instances --- .github/workflows/slowtest.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 2ed0d2f34d..fd21fbd042 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -77,7 +77,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - partition: [1, 2] + partition: [1, 2, 3, 4] steps: # These tests need the `anvil` binary provided by foundry - name: Install Foundry @@ -107,5 +107,5 @@ jobs: NEXTEST_PROFILE: slow run: | cargo nextest run --archive-file nextest-archive.tar.zst --verbose --no-fail-fast --nocapture \ - --workspace-remap $PWD --partition count:${{ matrix.partition }}/2 + --workspace-remap $PWD --partition count:${{ matrix.partition }}/4 timeout-minutes: 40