Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partition slow test #2338

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
81 changes: 68 additions & 13 deletions .github/workflows/slowtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,89 @@ 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 Diff Test
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1
- uses: actions/checkout@v4


- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
cache-provider: buildjet

- name: Build and archive tests
run: cargo build --locked --bin diff-test --release

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: diff-test
path: target/release/diff-test

slow-tests:
needs: [build-diff-test, build-test-artifacts]
runs-on: ubuntu-latest
strategy:
matrix:
partition: [1, 2, 3, 4]
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: Install nextest
uses: taiki-e/install-action@nextest

- name: Checkout Repository
uses: actions/checkout@v4

- name: Configure Environment
run: PATH="$PWD/target/release:$PATH"
- name: Download archive
uses: actions/download-artifact@v4

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true

- name: Build
- name: Move files
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --all-features --no-run
timeout-minutes: 90
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:
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 }}/4
timeout-minutes: 40
Loading