ci: add flaky-test management (#489) - #17
Merged
Merged
Conversation
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>
# Conflicts: # Cargo.lock # Cargo.toml
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci(flaky-test-management): fix nextest CPU-saturation starving the dev-server test (#489)
Root cause (not staleness): PR #489 switched CI
cargo test→cargo nextest run. nextest runs one global thread-pool (vscargo test's one-binary-at-a-time), so the wasmtime-heavy integration tests indigstore-cli+digstore-compilersaturate the 4-vCPU runner concurrently, starving the spawneddigstore devchild — it announces its port but can't get scheduled to answer/within the readiness poll →dev_serves_real_read_path_with_injected_shimsfails deterministically (3/3, both OS).Fix (two levers):
.config/nextest.toml— aheavy-integrationtest-group (max-threads = 2) overkind(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.yml—cargo test→cargo nextest run --workspace --locked --retries 2(+ a separatecargo test --docstep so doctests aren't dropped).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