You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: close the coverage gap on the bottleneck classifier's Rust surface
PR #311's coverage gate flagged the new backend surface as under-covered
(84.34% vs main's 84.56%). Adds targeted unit tests for every area the gate
report highlighted:
- bottleneck_hub.rs: extracted the AppHandle-independent decision logic out
of tick_once into pure, directly-testable helpers (account_signal,
aggregate_accounts, build_snapshot, should_emit), each covering a branch
the monolithic async function previously hid from a unit test. Also covers
BottleneckHub::push/latest directly.
- SyncOrchestrator::pacer_backoff_remaining_ms / backend_label: default
(unwired), wired-but-clear (FakePacer), and wired-and-throttled (a real
AimdPacer that has actually rate-limited) cases; plus a driven-app test
proving FakeOrchestrator inherits the Orchestrator trait's default bodies.
- AimdPacer::backoff_remaining_ms: already covered by the previous commit's
test, still verified against a FakeClock in and after the backoff window.
- IoCounters::add_hashed/snapshot: already covered by the previous commit's
test.
- Executor credit paths: new inline_upload (buffered, <4MiB) and
stream_upload (streaming cpu_stage, >=4MiB) tests asserting the hash
counter is credited the full plaintext size in both pipelines.
- Scanner credit path: a direct scan_with_priority call (bypassing the
scan()/scan_with_progress() wrappers, which always pass None) proving a
deep-verify re-hash credits the hash counter.
- assembly.rs: bottleneck_backend_label covers all four BackendKind variants
with distinct labels.
- app_state.rs: bottleneck_hub()/set_bottleneck_task()/shutdown_bottleneck_task()
round-trip (register, signal, join, idempotent no-op).
Residual uncovered lines are structural: tick_once's AppHandle/AppState
plumbing, the bottleneck_status Tauri command (needs a real tauri::State,
which this codebase has no harness to construct - matches the pre-existing
untested pattern for io_throughput_series/get_sync_status), the
emit_sync_bottleneck event (needs a real AppHandle, matches
emit_sync_io_throughput's own untested baseline), and the lib.rs sampler
spawn/drain wiring (needs full app boot). None of these are new patterns -
each mirrors an already-uncovered sibling that predates this PR.
Local cargo llvm-cov (same command as .github/workflows/coverage.yml) moved
83.73% -> 83.96% on this diff; cargo test / clippy -D warnings / fmt all
clean (1032 driven-core + driven-app tests passing).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xKUm9vH4ifb5LHR5szy1v
0 commit comments