Skip to content

test(rust): add application and Redis validation - #282

Draft
lan17 wants to merge 20 commits into
mainfrom
docs/rust-application-budgets
Draft

lan17 wants to merge 20 commits into
mainfrom
docs/rust-application-budgets

Conversation

@lan17

@lan17 lan17 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

The Rust guide describes application-owned budgets, but needs executable recipes and checks of their limits. Production-feature behavior and real Redis recovery also need coverage outside the main all-feature test workspace. No separate issue exists; this change follows a review of the public Rust guide and consumer/transport tests.

Change

Change types: Docs + Tooling. Keep the existing API and behavior contracts, and add grouped application and validation coverage:

  • Add tested recipes for source/provider admission, complete mutation waits, bounded retained values and nonblocking DogStatsD transport. Acquire native-work permits before scheduling and retain them until the native work finishes, including after caller abandonment.
  • Add an isolated production consumer and a separate CI step. Its assertions exercise the shipped JSON renderer without test-util, including truncation, serialization failures and panic containment.
  • Add opt-in synthetic scale and real Redis mixed-load fixtures. Keep offered, admitted, terminal and underlying-work accounting separate. Drain owned work and distinguish fixed-window results from eventual completion.
  • Cover TLS/client authentication, reconnect, partial and lost replies, ambiguous timed-out mutations, native Sentinel discovery and promotion, and watermark/script recovery.
  • Bind startup readiness to the live child PID. Retain fresh per-run authentication across a mixed-load restart. Use private files and verified private-CA TLS for Sentinel and discovered nodes. Check that a competing server at the retired port receives no workload or reconfiguration effects.
  • Retry only transient replica INFO timeouts in the existing startup wait. Keep its deadline check and polling delay; other errors remain fatal. Native command timing and the cooperative whole-test timeout are unchanged.
  • Require patched Tokio/zstd dependencies and update the root and two isolated lockfiles. Test-only TLS/Sentinel features do not become library defaults.
  • Clarify native timeout scope, lockfile-specific Rust requirements and the CPU pool's independence from Tokio thread limits. Refresh the affected documentation audit records and course section count.

No rust/src, portable model, replay driver or toolchain file changes. No new public API or behavior contract requires a design record. The dependency updates affect runtime builds; the resource policies remain consumer-owned examples, not automatic service protections.

Ending a wait does not prove native or server cancellation. Entry count and serialized size are not process-memory bounds. Codec validation follows decompression. CPU counters cover offloaded work, not all CPU execution. No live metric-delivery, capacity, high-availability or leak-freedom claim is made.

Ports

Port Status
TypeScript N/A: no implementation change
Go N/A: no implementation change; audit digest refreshed
Rust Recipes, isolated consumers, transport/load fixtures, dependency corrections and CI validation added
Python N/A: no implementation change

Validation

Head: 279b57a2e2f95c9dd5e94359fbbbb137166381c2

Results below ran on this head's inputs. Passing results are reused where the relevant source, manifests, locks and toolchain are unchanged. Earlier-head hosted CI is not reused.

  • make check-rust: passed on the patched dependency graph; 223 passed, zero failed, eight expected ignored. Formatting, both Clippy modes and 1,795 conformance vectors passed. Its library, recipe, scale-test and dependency inputs are unchanged at this head.
  • cargo test --locked --all-features --manifest-path rust/Cargo.toml --test docs_examples -- --include-ignored: 16 passed with an owned disposable Redis and DOCS_REDIS_URL. Recipe and library inputs are unchanged.
  • In rust/tests/production_consumer, the locked feature tree, formatting, all-target Clippy with warnings denied and cargo run --locked passed. All ten assertion groups passed. Forcing dialcache/test-util failed at the expected absent-versus-JSON-null assertion; the restored production run passed.
  • The isolated transport crate passed formatting and all-target Clippy. cargo test --locked --manifest-path rust/tests/redis_transport_recovery/Cargo.toml --test transport -- --test-threads=1 passed all eight cases after the startup repair.
  • The ignored cleanup_controls and a DIALCACHE_REDIS_LOAD_SECONDS=10 mixed-load smoke passed. All admitted calls terminated and tracked underlying work drained. Owned Redis processes were reaped and fixture directories removed.
  • Private countercontrols failed as intended when PID/liveness checks, reconnect authentication or Sentinel trust isolation were removed. The trust control observed actual SLAVEOF and CONFIG REWRITE, a changed role and a changed configuration file. All bypasses were restored. A controlled replica delay reproduced the startup timeout before the repair and recovered afterward without increasing the command timeout.
  • make audit passed at this head. make docs and cargo package --locked --manifest-path rust/Cargo.toml --all-features passed on unchanged relevant inputs. The isolated transport fixture is not part of that package.
  • Independent cargo-audit 0.23.0 checks of all three lock graphs found zero vulnerability or unsound matches, without ignores or target/severity filters. RustSec database: 4ef2df8e806a65e2f1ecc14f56f51249062b23d6. The existing yoke-derive 0.8.3 yank warning remains in the root and transport graphs. This is not a repository-wide security clearance.
  • Fresh correctness, tests, simplicity, architecture, contracts, security, reliability, performance and two-stage holistic review found no remaining material issue. A separate rollout-safety review found no material blocker. Reviews were read-only; execution evidence is recorded separately.
  • Public-content review found no private information. Visual evidence is not applicable to these test, documentation, dependency and CI changes.

Local tools: Rust 1.98.1, Node 24.22.3, pnpm 10.33.0, Go 1.27.1, Redis 8.0.5 and OpenSSL 3.5.5.

PR CI is pending at publication for this head. Keep the pull request in draft. The required test check, Rust job, fixtures-check and all four differential shards must pass on the new head; earlier successful runs do not establish that result.

Not run locally: the five Docker-backed integration cases, the ignored doctest, and the hosted fixture/differential matrix. The CI Rust job runs the Redis/Valkey integration matrix. Full formal replay and mutation campaigns are not required by this diff's unchanged model/toolchain/driver inputs. Longer Redis observations and validation with separate runtime fixes are not claimed as results for this standalone head.

Follow-ups

None required for this change. Consumers must choose their own limits, configure native client budgets and verify actual task lifetime and telemetry delivery. Optional longer observations do not replace workload-specific validation.

@codecov-commenter

codecov-commenter commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (22c1f50) to head (279b57a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
+ Coverage   94.76%   94.95%   +0.18%     
==========================================
  Files          84       84              
  Lines       13168    13168              
  Branches      805      805              
==========================================
+ Hits        12479    12504      +25     
+ Misses        623      598      -25     
  Partials       66       66              
Flag Coverage Δ
go 93.90% <ø> (+0.04%) ⬆️
python 93.60% <ø> (ø)
rust 95.11% <ø> (+0.33%) ⬆️
typescript 97.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lan17 lan17 changed the title docs(rust): add bounded application recipes test(rust): add application and Redis validation Nov 13, 2026

This branch has not been deployed

No deployments
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.

2 participants