From 66b9c8c6bc9e0bbb18f6f0d49fc4a0b3dd24cca8 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Fri, 18 Oct 2024 22:39:17 +0300 Subject: [PATCH] ci: Terminate `nextest` after a test runs for three minutes (#2192) * 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 --- .config/nextest.toml | 5 +++++ .github/workflows/check.yml | 11 ++++++----- .github/workflows/sanitize.yml | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000000..c7c5545dc9 --- /dev/null +++ b/.config/nextest.toml @@ -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 } diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1b9c2e8200..d9179bc35e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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 }} @@ -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 @@ -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: diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index 4d6bef060a..2862a221e5 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -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