From 1b0f95910baefe32371a371326fd3f72675282a6 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 27 Jan 2025 14:03:59 -0600 Subject: [PATCH] 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 --- .config/nextest.toml | 3 +++ .github/workflows/build.yml | 2 +- flake.nix | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..c32ea51a8 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,3 @@ +[profile.ci] +slow-timeout = { period = "5s", terminate-after = 20 } +fail-fast = false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 870d064d5..17fc161f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/flake.nix b/flake.nix index c38738c75..a1a9042ab 100644 --- a/flake.nix +++ b/flake.nix @@ -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/"