Repository navigation
test: allow zero coverage in resource sampling checks - #483
mnajafian-nv wants to merge 1 commit into
Conversation
Sparse valid readings can produce zero covered time. Accept the full coverage range while preserving spike, artifact and result checks. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
|
No actionable comments were generated in the recent review. ℹ️ Recent review info
📜 Recent review details
WalkthroughThe Rust and Python sampling tests now allow ChangesSampling coverage tests
Priority: Estimated code review effort: 2 (Simple) | ~5 minutes Change: Other Merge Risk:
|
|
Fern docs preview: https://nvidia-preview-pull-request-483.docs.buildwithfern.com/nemo/fabric |
Overview
Resource sampling can collect valid memory values without covering any elapsed time. Coverage counts only intervals between adjacent valid readings that are no longer than twice the requested sampling interval.
The SDK and Rust integration tests require positive coverage. The SDK assertion has failed on macOS with a valid
covered_fractionof0.0. Accept the full[0, 1]range in both checks so a valid partial measurement does not fail these tests.Details
Add a short comment at each assertion explaining why zero is valid. The Rust test still requires the sampled memory peak to exceed the final reading by more than 128 MiB. Both tests retain their sample-count, artifact, identity and final-timestamp checks. The SDK test also retains its typed-result and serialization checks.
The deterministic gauge tests continue to require full positive coverage when readings qualify and exclude missing readings or long gaps.
Validation
The TypeScript adapter checks remain blocked by the shared dependency audit tracked in #484.
The SDK test module and the focused Rust runtime and sampling tests pass. Formatting passes.
The previous SDK assertion failed in the Python 3.11 macOS job and the Python 3.14 macOS job. Full-suite result pending.
Where should the reviewer start?
Start with the coverage assertions in
tests/python/test_system_stats.pyandsampled_stats_capture_transient_worker_memory_and_preserve_correlationincrates/fabric-core/src/runtime.rs. Compare them withGauge::push,Gauge::finishand the deterministic tests incrates/fabric-core/src/system_stats/sampling.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to: none
I confirm this contribution is my own work, or I have the right to submit it under this project's license.
I searched existing issues and open pull requests, and this does not duplicate existing work.
Summary by CodeRabbit