Skip to content

Commit

Permalink
ci: Terminate nextest after a test runs for three minutes (#2192)
Browse files Browse the repository at this point in the history
* ci: Terminate `nextest` after a test runs for five minutes

Terminating it ourselves means that later CI steps run (like exporting
the simulator seeds), which doesn't happen when GitHub terminates the
entire runner.

* Fix seed export on Windows

* Fix quoting

* Fix
  • Loading branch information
larseggert authored Oct 18, 2024
1 parent 2b64d75 commit 66b9c8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.ci]
# Do not cancel the test run on the first failure.
fail-fast = false
# Terminate test after three slow periods of 60 seconds.
slow-timeout = { period = "60s", terminate-after = 3 }
11 changes: 6 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
DUMP_SIMULATION_SEEDS: /tmp/simulation-seeds

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand Down Expand Up @@ -86,11 +85,13 @@ jobs:
env:
RUST_LOG: trace
run: |
DUMP_SIMULATION_SEEDS="$(pwd)/simulation-seeds"
export DUMP_SIMULATION_SEEDS
# shellcheck disable=SC2086
if [ "${{ matrix.rust-toolchain }}" == "stable" ]; then
cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --features ci --no-fail-fast --lcov --output-path lcov.info
cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --features ci --profile ci --lcov --output-path lcov.info
else
cargo +${{ matrix.rust-toolchain }} nextest run $BUILD_TYPE --features ci --no-fail-fast
cargo +${{ matrix.rust-toolchain }} nextest run $BUILD_TYPE --features ci --profile ci
fi
- name: Run client/server transfer
Expand Down Expand Up @@ -121,11 +122,11 @@ jobs:
if: matrix.type == 'debug' && matrix.rust-toolchain == 'stable'

- name: Save simulation seeds artifact
if: env.DUMP_SIMULATION_SEEDS
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: simulation-seeds-${{ matrix.os }}-${{ matrix.rust-toolchain }}-${{ matrix.type }}
path: ${{ env.DUMP_SIMULATION_SEEDS }}
path: simulation-seeds
compression-level: 9

bench:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
PWD=$(pwd)
export LSAN_OPTIONS="suppressions=$PWD/suppressions.txt"
fi
cargo nextest run -Z build-std --features ci --target "$TARGET"
cargo nextest run -Z build-std --features ci --profile ci --target "$TARGET"
- name: Save simulation seeds artifact
if: env.DUMP_SIMULATION_SEEDS
Expand Down

0 comments on commit 66b9c8c

Please sign in to comment.