Skip to content

Commit d197725

Browse files
committed
ci(test): move CI to ARM64 runners and scope nextest retries
Switch both CI jobs to the free ubuntu-24.04-arm runners and link test binaries with mold to cut the --all-features cold-cache link time. Also stop applying the cluster tests' high retry count profile-wide; give it back to them via a dedicated ci-profile override so ordinary single-node tests aren't penalized by a retry budget meant for cluster bring-up jitter.
1 parent 63cdbb4 commit d197725

2 files changed

Lines changed: 40 additions & 12 deletions

File tree

.config/nextest.toml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,26 @@ server-process-serial = { max-threads = 1 }
110110

111111
[profile.ci]
112112
# CI inherits the default profile (cluster group, threads-required,
113-
# slow-timeout) and adds:
114-
# - more retries: CI runners are ~2× slower per-core than dev
115-
# workstations, so the cluster tests' in-test `wait_for`
116-
# budgets are proportionally tighter. Three retries (four total
117-
# attempts) buys headroom for jitter without papering over real
118-
# regressions — a genuinely broken test fails four times in a row.
119-
# - JUnit XML: picked up by the workflow's artifact upload.
113+
# slow-timeout) and adds retries + JUnit XML.
114+
#
115+
# Retries are scoped, not blanket. The bulk of the suite (unit tests +
116+
# single-node server tests) is deterministic; the ONE non-cluster flake
117+
# source is the rare ephemeral-port reuse race in the `server-process`
118+
# group, which a single retry covers. So the profile-wide retry is just
119+
# `count = 1` (two attempts). A blanket high count here is worse than
120+
# useless: nextest resolves retries per-test with overrides winning over
121+
# the profile-wide value, so a high number here never even reached the
122+
# cluster tests (their `default` override pins count = 2) — it only
123+
# multiplied the timeout tail of every slow single-node server test by
124+
# 4×. The cluster tests get their genuine CI headroom from the dedicated
125+
# override below instead.
120126
#
121127
# NOTE: we deliberately do NOT bump `slow-timeout` here. The
122128
# slow-timeout only controls when nextest gives up on a stuck
123129
# *process*; it does NOT extend the test's internal `wait_for`
124130
# budgets. Once a `wait_for` panics, the test has already failed —
125131
# making nextest wait longer just wastes CI minutes on cleanup.
126-
retries = { backoff = "fixed", count = 3, delay = "2s" }
132+
retries = { backoff = "fixed", count = 1, delay = "2s" }
127133
fail-fast = false
128134

129135
# Four cluster tests are excluded from the CI profile ONLY. They still run under
@@ -157,5 +163,16 @@ not (
157163
)
158164
"""
159165

166+
# CI-only cluster headroom. On CI runners (~2× slower per-core than a dev
167+
# workstation) the cluster tests' in-test `wait_for` budgets are proportionally
168+
# tighter, so 3-node bring-up jitter needs more retry headroom than the
169+
# `default` profile's count = 2. Four attempts absorbs startup jitter without
170+
# hiding regressions — a genuinely broken test fails four times in a row. This
171+
# `ci`-profile override is checked before the `default`-profile cluster override
172+
# and so wins under `--profile ci`; local `cargo nextest run` still gets count = 2.
173+
[[profile.ci.overrides]]
174+
filter = 'package(nodedb-cluster-tests)'
175+
retries = { backoff = "fixed", count = 3, delay = "2s" }
176+
160177
[profile.ci.junit]
161178
path = "junit.xml"

.github/workflows/test.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,21 @@ permissions:
2222

2323
env:
2424
CARGO_TERM_COLOR: always
25+
# Link the workspace's test binaries with mold instead of the default BFD
26+
# linker. With --all-features every test binary statically links the full
27+
# dependency closure and there are hundreds of them, so linking — not
28+
# codegen — dominates the cold-cache build. mold cuts that link time several-
29+
# fold. Applies to both jobs; installed via apt below.
30+
RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
2531

2632
jobs:
2733
lint:
2834
name: Lint & Check
29-
runs-on: ubuntu-latest
35+
# Free ARM64 runner for public repos: ~40% faster per-core than
36+
# ubuntu-latest at the same (zero) cost. The release workflows already
37+
# build on ubuntu-24.04-arm, so the toolchain + system deps are proven
38+
# on this ISA.
39+
runs-on: ubuntu-24.04-arm
3040
steps:
3141
- uses: actions/checkout@v7
3242
- name: Install Rust
@@ -41,7 +51,7 @@ jobs:
4151
sudo apt-get update
4252
sudo apt-get install -y --no-install-recommends \
4353
cmake clang libclang-dev pkg-config protobuf-compiler perl \
44-
libcurl4-openssl-dev libsasl2-dev
54+
libcurl4-openssl-dev libsasl2-dev mold
4555
- name: Check formatting
4656
run: cargo fmt --all -- --check
4757
- name: Run clippy
@@ -72,7 +82,8 @@ jobs:
7282
# serialised by `.config/nextest.toml`'s `cluster` test group.
7383
test:
7484
name: Test
75-
runs-on: ubuntu-latest
85+
# Free ARM64 runner — see the lint job for rationale.
86+
runs-on: ubuntu-24.04-arm
7687
steps:
7788
- uses: actions/checkout@v7
7889
- name: Reclaim disk and record resources
@@ -109,7 +120,7 @@ jobs:
109120
sudo apt-get update
110121
sudo apt-get install -y --no-install-recommends \
111122
cmake clang libclang-dev pkg-config protobuf-compiler perl \
112-
libcurl4-openssl-dev libsasl2-dev
123+
libcurl4-openssl-dev libsasl2-dev mold
113124
- name: Install cargo-nextest
114125
uses: taiki-e/install-action@v2
115126
with:

0 commit comments

Comments
 (0)