test(api-core): re-enable the three rack-handler tests against current behavior#2735
Conversation
…t behavior Three rack state-controller tests were `#[ignore]`d because they asserted an old state-machine vocabulary the handlers no longer use -- not because of any handler bug. They now pin the handlers' actual, intended behavior and run again. `created.rs` returns `Wait` (not `DoNothing`) while device counts are below the profile's expectation and transitions once they meet or exceed it; `discovering.rs` waits for compute to become ready rather than faulting on a missing host. So `test_expected_incomplete_device_counts_stays` now asserts `Wait`; `test_discovering_waits_for_compute_ready` becomes `test_discovering_waits_when_compute_not_ready` and asserts `Wait`; and `test_expected_more_discovered_than_expected_transitions` now seeds two hosts against the single-compute profile so it genuinely exercises the over-discovery transition it always claimed to test. No production change -- the handlers were already correct, corroborated by the adjacent passing tests. Addresses NVIDIA#2715. Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
@coderabbitai PTAL, thanks! |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThree previously ignored rack state-controller handler tests are re-enabled by removing their ChangesRack State-Controller Test Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Details ==="
gh pr view 2735 --repo NVIDIA/infra-controller --json title,body,files,additions,deletions,state
echo ""
echo "=== PR Diff ==="
gh pr diff 2735 --repo NVIDIA/infra-controllerLength of output: 7570
Overall: Approved — test-only, no production risk. Per-test review
One minor observationIn "Discovering should wait when compute hosts are not yet ready, got {:?}",
std::mem::discriminant(&outcome)
[approve] |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
The three rack state-controller tests surfaced by #2694 were
#[ignore]d because they assert an old state-machine vocabulary the handlers no longer use -- not because of any handler bug (confirmed:created.rs/discovering.rsare correct, corroborated by adjacent passing tests). They now pin current behavior and run again:test_expected_incomplete_device_counts_stays→ assertsWait(wasDoNothing).test_discovering_waits_for_compute_ready→ renamedtest_discovering_waits_when_compute_not_ready, assertsWait(wasErr).test_expected_more_discovered_than_expected_transitions→ now seeds two hosts against the single-compute profile so over-discovery genuinely exceeds expected, keeping theTransition(Discovering)assertion; dropped the deadmac1line + stale comment.No production change. Verified:
cargo test -p carbide-api-core --lib -- rack_state_controller::handler→ 42 passed, 0 ignored;clippy --locked --all-targets --all-features+ nightly rustfmt clean.Addresses #2715.