test: add deterministic Slurm fakes - #888
Conversation
Greptile SummaryAdds deterministic test infrastructure for Slurm commands, dependency installation, plugin discovery, serving lifecycles, and readiness-state fixtures.
|
| Filename | Overview |
|---|---|
| packages/data-designer-slurm/tests/slurm_test_fakes/slurm.py | Adds a stateful fake runner for deterministic sbatch, squeue, sacct, scancel, and bounded sinfo behavior. |
| packages/data-designer-slurm/tests/slurm_test_fakes/serving.py | Adds explicit backend and logical-endpoint lifecycle, publication, routing, overload, failure, and cleanup behavior. |
| packages/data-designer-slurm/tests/conftest.py | Centralizes shared contract records and deterministic infrastructure fixtures at the Slurm test-suite root. |
| packages/data-designer-slurm/tests/slurm_test_fakes/dependencies.py | Adds scripted resolver and installer doubles with exact call and outcome verification. |
| packages/data-designer-slurm/tests/state/test_transition_fixtures.py | Extends canonical readiness-transition fixture coverage across pending, starting, failure, and stopped states. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Tests[Slurm integration tests] --> SlurmFake[Fake Slurm runner]
Tests --> DependencyFakes[Dependency resolver and installer fakes]
Tests --> PluginOverlay[Installed-layout plugin overlay]
Tests --> ServingFake[Logical endpoint and backend fakes]
SlurmFake --> SchedulerStates[Scripted scheduler states and outputs]
ServingFake --> ReadinessStates[Startup, readiness, failure, and cleanup states]
Reviews (2): Last reviewed commit: "test: complete post-F3 Slurm fake covera..." | Re-trigger Greptile
|
Fern preview: https://nvidia-preview-pr-888.docs.buildwithfern.com/nemo/datadesigner
|
Code Review: PR #888 —
|
|
Thanks for putting this together, @andreatnvidia! SummaryThis adds deterministic, test-only doubles for Slurm commands, dependency installation, plugin discovery, controlled time, and single-/multi-backend serving, along with canonical readiness-transition fixtures. The implementation matches the stated F4 foundation and stays cleanly isolated from production code. FindingsNo code correctness findings. I also checked the existing PR feedback and did not repeat the already-raised The branch does need a refresh before merge: #879 has since merged into What Looks Good
VerdictNeeds changes — the implementation itself looks ready, but the branch must be rebased and the rename conflict resolved before merge. The changed tests passed locally (51 passed), Ruff check and format validation passed, and the previous GitHub CI run was green; CI should run again after the rebase. This review was generated by an AI assistant. |
Add reusable scheduler, dependency, plugin, serving, clock, and state-transition fixtures for local and CI Slurm integration tests. Keep the harness deterministic and isolated from production lane implementations. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Promote the merged planning and finalization goldens to package-wide fixtures, exercise dependency doubles with canonical records, and add site-neutral rendered script goldens for downstream lanes. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Bind rendered scripts and shared fixtures to the merged contracts, tighten scheduler command behavior, and cover retry terminal states and invalid serving restarts. Signed-off-by: Andre Manoel <amanoel@nvidia.com>
9bc2153 to
14f5dee
Compare
nabinchha
left a comment
There was a problem hiding this comment.
Thanks for the thorough follow-up, @andreatnvidia!
Summary
This adds the shared deterministic Slurm test harness, promotes the merged F3 contract fixtures for package-wide reuse, and fills out scheduler, serving, dependency, plugin, script, and readiness-transition coverage. The updated implementation matches PR #888 and issue #872’s stated scope; the post-F3 additions are the contract-bound fixtures that earlier commits could not include before #879 and #889 landed.
Findings
No actionable findings on the updated head.
What Looks Good
- The fake scheduler keeps state and failure injection explicit while covering arrays, accounting lag, cancellation, retry terminal spellings, malformed output, and bounded command shapes.
- The package-wide fixtures reuse the reviewed planning and finalization contracts instead of creating lane-specific substitutes, which is exactly what downstream #866–#869 need.
- The serving doubles exercise lifecycle boundaries, multi-backend routing, overload preservation, publication failure, terminal restart rejection, and idempotent endpoint cleanup without external processes.
Verdict
Ship it — ready to merge as-is. I re-ran the complete Slurm package suite in an isolated installed-package environment (399 passed), Ruff check/format passed, and both rendered scripts passed bash -n.
This review was generated by an AI assistant.
📋 Summary
Adds the F4 foundation for Gate B with deterministic test doubles for Slurm commands, dependency installation, plugin discovery, and multi-backend serving. Stage 2 lanes can test observable infrastructure boundaries against the canonical F3 contracts without Slurm, GPUs, containers, model servers, or new production abstractions.
🔗 Related Issue
Closes #872
Part of #850
🔄 Changes
✨ Added
sbatch,squeue,sacct,scancel, and boundedsinforunner with arrays, strict output formats, active and terminal states, cancellation, accounting lag, malformed output, command failures, call logs, and explicit state control.🔧 Changed
🔍 Attention Areas
slurm.py- scheduler boundary behavior, terminal precedence, bounded queries, and failure scripting.serving.py- logical endpoint lifecycle, overload routing, backend failure, and cleanup behavior.conftest.py- package-wide canonical F3 fixture ownership for Stage 2 consumers.🧪 Testing
make testpasses (not run; the scoped Slurm targets cover this test-only package change).venv/bin/ruff check --fix ..venv/bin/ruff format .make check-slurmmake test-slurm(399 passed)bash -ngit diff --checkmake test-slurm-wheel-install(not applicable; packaging and installed behavior are unchanged)✅ Checklist
Description updated with AI