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
This commit is contained in:
Lars Eggert 2024-10-18 22:39:17 +03:00 коммит произвёл GitHub
Родитель 2b64d7536e
Коммит 66b9c8c6bc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 12 добавлений и 6 удалений

5
.config/nextest.toml Normal file
Просмотреть файл

@ -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
.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:

2
.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