Repository navigation
Conversation
`rocm storage remove-old-installs` deletes multi-gigabyte install folders from a set the user never listed, so its safety rules are worth testing over generated input rather than examples alone. Property tests for the pure policy (`select_runtimes_to_remove`), 2048 cases each: - the install in use, the rollback target, anything the active-runtime marker names and anything ROCm CLI does not own are never selected, including at `--keep 0`; - each retention group keeps exactly its `--keep` most recent installs that nothing else holds (ties broken by key) and removes the rest, and raising `--keep` never removes more; - every install is kept or removed exactly once, and each kept install is reported with the first hold reason that applies; - every selected key resolves, through the real `select_runtime_manifest`, to that same install rather than to a case twin of it. The expected groups and holds are computed in the test from the `--keep` help and the matching rules the policy implements, not with the policy's own helpers. Generators draw from small, weighted alphabets so case-twin keys, shared runtime ids, tied install times, flag/specs disagreement on the toolchain choice and groups with more candidates than `--keep` actually occur; a deterministic reach report fails if they stop. A second property, 256 cases, applies whole plans to real registry files and install folders through the real removal call and checks the install in use survives. The checked-in regression seed is a case-twin input that fails when the runtime selector fix from #497 is reverted. docs/testing.md gains a "Removing Old Installs" section listing the commands. Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
rocm storage remove-old-installsdeletes multi-gigabyte install folders from a set the user never listed one by one, so a retention bug destroys data the user did not choose to lose. The example tests instorage::testspin specific scenarios, but the dangerous inputs are combinations: pointers spelled in a different case, two installs whose keys differ only in case, a whole family sharing one runtime id, tied install times, a pointer naming nothing,--keep 0. Property tests over those combinations are what found the case-twin runtime-key defect fixed in #497; this change lands the suite itself so it keeps guarding the policy.What changes
Property tests for the pure retention policy (
select_runtimes_to_remove), 2048 cases each:--keep 0;--keepmost recent installs that nothing else holds (ties broken by key) and removes the rest; raising--keepnever removes more;HoldReasondeclares them;select_runtime_manifest, to that same install rather than to a case twin of it.The expected groups and holds are computed in the test from the
--keephelp and the matching rules the policy implements, not by calling the policy's helpers, so a defect in one of those helpers cannot hide itself. Generators draw from small, weighted alphabets so the rare inputs above actually occur, plus toolchain records whosedevelflag disagrees with their recorded package specs;generator_reach_reportis a deterministic measurement that fails if the generators stop reaching them.A second property (256 cases) applies whole generated plans to real registry files and install folders through the real removal call and checks that the install in use survives.
The checked-in regression seed is a case-twin input that fails when the #497 selector fix is reverted.
docs/testing.mdgains a "Removing Old Installs" section with the commands.Verification
cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningsare clean;cargo test -p rocm --bin rocm storage::passes 31/31.select_runtime_manifestresolves newest case-insensitive match first (the defect #497 fixed), seed file removedthe_deleter_resolves_each_selected_key_to_the_install_the_policy_cleared(fresh run)develflageach_group_keeps_its_most_recent_installs_and_removes_the_resteach_group_keeps_…every_hold_reason_is_the_first_that_applies,each_group_keeps_…every_hold_reason_is_the_first_that_appliesthe_install_in_use_is_never_selected_for_removal,applying_a_whole_plan_never_removes_the_install_in_usedevelextra matched bycontains, withouttrim, or under any package's[each_group_keeps_…,every_hold_reason_is_…Not covered:
RetentionInputs::from_config(how config and the marker file become pointers) — the properties buildRetentionInputsdirectly. Extras spelledDeveland requirements on otherrocm-*packages are not generated.Scope
Test and docs only; no production code changes. No e2e scenario is added because no user-observable behaviour changes. The retention properties in
therock::version_proptests(order independence, recency over version) are left where they are; the new module cross-references them.tests/e2e-cucumber/expectations.tomlfor the fixed ticket ID and removed/narrowed any now-stale xfail rows. — N/A, test-only.docs/architecture.md. — N/A.