github: track slow tests in CI builds

Some of our builds have been timing out, and one angle I want to look at
is whether any tests are hanging. Nextest can help us keep track of slow
tests in CI where the underlying hosts will have significantly higher
load. In general this should also help keep our tests healthy, IMO.

I don't see any reason why any existing test should take over 20
seconds, but it should at least help control for really slow runners
that have huge latency spikes. we can start there and see how it goes
in practice.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2025-01-27 14:03:59 -06:00
parent 5b5a9e71c3
commit 1b0f95910b
3 changed files with 5 additions and 1 deletions

3
.config/nextest.toml Normal file
View file

@ -0,0 +1,3 @@
[profile.ci]
slow-timeout = { period = "5s", terminate-after = 20 }
fail-fast = false

View file

@ -88,7 +88,7 @@ jobs:
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test
run: |
cargo nextest run --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
cargo nextest run --workspace --profile ci --all-targets --verbose ${{ matrix.cargo_flags }}
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

View file

@ -97,6 +97,7 @@
buildFeatures = ["packaging"];
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
useNextest = true;
cargoTestFlags = ["--profile" "ci"];
src = filterSrc ./. [
".*\\.nix$"
"^.jj/"