Skip to content

ci: add flaky-test management (#489) - #17

Merged
MichaelTaylor3d merged 7 commits into
mainfrom
ci/flaky-test-management
Jul 16, 2026
Merged

ci: add flaky-test management (#489)#17
MichaelTaylor3d merged 7 commits into
mainfrom
ci/flaky-test-management

Conversation

@MichaelTaylor3d

@MichaelTaylor3d MichaelTaylor3d commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

ci(flaky-test-management): fix nextest CPU-saturation starving the dev-server test (#489)

Root cause (not staleness): PR #489 switched CI cargo testcargo nextest run. nextest runs one global thread-pool (vs cargo test's one-binary-at-a-time), so the wasmtime-heavy integration tests in digstore-cli + digstore-compiler saturate the 4-vCPU runner concurrently, starving the spawned digstore dev child — it announces its port but can't get scheduled to answer / within the readiness poll → dev_serves_real_read_path_with_injected_shims fails deterministically (3/3, both OS).

Fix (two levers):

  • .config/nextest.toml — a heavy-integration test-group (max-threads = 2) over kind(test) & (package(digstore-cli) | package(digstore-compiler)), bounding the heavy integration tests so the runner keeps scheduler slack; fast unit tests keep full parallelism.
  • crates/digstore-cli/tests/cli_dev.rs — readiness budget widened (poll 40s→90s, per-request read timeout 10s→30s) as insurance; the assertion is unchanged (still asserts the dev server serves the real read path).
  • ci.ymlcargo testcargo nextest run --workspace --locked --retries 2 (+ a separate cargo test --doc step so doctests aren't dropped).
  • Rebased on origin/main; version 0.13.4→0.13.5 (patch, CI-only).

All 10 checks green. Closes #489.

Co-Authored-By: Claude noreply@anthropic.com

MichaelTaylor3d and others added 7 commits July 12, 2026 13:34
Switch the CI test job to cargo-nextest (--retries 2) so intermittent
test failures surface as FLAKY in the run summary instead of being
silently retried away; doctests (unsupported by nextest) run as a
separate step to preserve coverage. Applied to both the workspace test
job and the dig-client-wasm parity-test job.

Audited the tag/deploy/publish workflows (release.yml, publish-binary.yml,
publish-npm.yml): none re-run the full PR-gated test suite at deploy time.
publish-binary.yml's targeted dighost_serve contract gate stays — it
verifies the actual release-target (static-musl) binary's proof output
against the deployed verifier, not a redundant full-suite re-run.

Cargo.toml workspace version bumped 0.13.0 -> 0.13.1 (patch, CI-only
change, no public API/behaviour change); Cargo.lock version entries for
the workspace-version-tracking crates updated to match.

Co-Authored-By: Claude <noreply@anthropic.com>
cargo nextest run does not instrument coverage; a bare nextest step
alongside cargo-llvm-cov collects zero lines and silently drops the
>=80% gate. Switch both test steps to the combined
`cargo llvm-cov nextest --fail-under-lines 80` form so llvm-cov drives
nextest directly and the coverage gate keeps enforcing.

Co-Authored-By: Claude <noreply@anthropic.com>
dig-client-wasm's own-file coverage isn't meaningful (its wasm-bindgen
glue is exercised by the "Verify assembled package" e2e step, not the
native parity tests); adding --fail-under-lines there just introduced
a new, unrelated failure. Revert that job to plain flaky-aware nextest
and keep the llvm-cov+nextest combined coverage gate on the workspace
build & test job, which is what CLAUDE.md's coverage-gate rule targets.

Co-Authored-By: Claude <noreply@anthropic.com>
…489)

cargo llvm-cov nextest slowed the instrumented digstore binary that CLI
integration tests spawn as a child process (e.g. cli_dev's dev-server
startup poll), consistently blowing existing CI-tuned timeouts and
failing on both ubuntu-latest and windows-latest. main has no coverage
gate today, so this flaky-test-management PR must not introduce one
(a stricter gate than main is out of scope here). Keep nextest's
flaky-run detection/retries; drop llvm-cov instrumentation and the
80%-lines gate entirely — a future PR can add coverage measurement as
its own reviewable change.

Co-Authored-By: Claude <noreply@anthropic.com>
Under `cargo nextest run` the whole workspace's tests share one num-cpus
pool, so on the 4-vCPU CI runners several digstore-cli integration tests
JIT-compiling the guest wasm in wasmtime pile up at once and starve the
cli_dev dev-server child past its 40s readiness poll — failing
dev_serves_real_read_path_with_injected_shims ("dev server did not come
up") deterministically on ubuntu-latest and windows-latest. `cargo test`
never hit this because it runs test binaries one at a time.

Add .config/nextest.toml: a `cli-integration` test-group (max-threads=2)
over `package(digstore-cli) & kind(test)`, so the heavy child-spawning
integration tests get enough CPU to start while fast unit tests keep full
parallelism — mirroring why cargo test was green without giving up
nextest's flaky-run detection.

Co-Authored-By: Claude <noreply@anthropic.com>
The prior cap covered only digstore-cli's integration tests, but the SLOW
(>60s) digstore-compiler tests (large_data_section, self_serving) kept
running at full concurrency and saturated the 4-vCPU CI runners — so
cli_dev's `dev` child process still couldn't get its tokio serve loop
scheduled to answer `/` within the readiness poll, failing
dev_serves_real_read_path_with_injected_shims deterministically on both
OSes.

- Widen the nextest test-group to ALL heavy integration tests across
  digstore-cli AND digstore-compiler, capped at 2 concurrent, so the
  runner always retains scheduler slack for the dev child while fast
  unit tests keep full parallelism (a local --test-threads 2 full-suite
  run reproduces green).
- Widen the dev-server readiness budget (poll window 40s -> 90s,
  per-request read timeout 10s -> 30s) as independent insurance: on a
  loaded runner the child's serve loop may be scheduled late, and the
  test must outlast that rather than give up early.

Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d merged commit dadb8ba into main Jul 16, 2026
11 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the ci/flaky-test-management branch July 16, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant