Skip to content

tests: add volume-delete retry e2e test#1217

Draft
eriknordmark wants to merge 1 commit into
lf-edge:masterfrom
eriknordmark:test-volume-delete-retry
Draft

tests: add volume-delete retry e2e test#1217
eriknordmark wants to merge 1 commit into
lf-edge:masterfrom
eriknordmark:test-volume-delete-retry

Conversation

@eriknordmark

Copy link
Copy Markdown
Contributor

An evetestkit suite exercising the volume-delete retry behavior on a kubevirt/longhorn EVE-k node.

  • TestVolumeDeleteRetryRecovers: deploy a tiny VM app, wait for its volume to reach the Created sub-state, arm a delete fault on the device and remove the app, assert the VolumeStatus is retained in the Deleting sub-state with an error (retried, not leaked), then clear the fault and assert the volume disappears.
  • TestVolumeDeleteGivesUp: same setup but keep the fault armed, and assert the volume disappears after the bounded retry budget is exhausted.

Volume state is read directly off the device (/run/volumemgr/VolumeStatus) because controller-reported state lags.

Requirements

Validation

Run on host EVE-k (master base):

  • With #6176 present: TestVolumeDeleteRetryRecovers PASS; TestVolumeDeleteGivesUp PASS.
  • Without #6176 (fault gates present, fix absent): TestVolumeDeleteRetryRecovers FAILS at the "retained in Deleting" assertion — i.e. the test catches the pre-fix leak.

Known caveat (draft)

The bounded give-up is maxVolumeDeleteRetries × the volumemgr gc tick (timer.gc.vdisk/10 s). TestMain lowers timer.gc.vdisk to its 60 s minimum, but volumemgr only (re)creates its gc ticker at boot, so the fast tick requires an EVE reboot after the setting is applied. Wiring that reboot into TestMain is a follow-up; TestVolumeDeleteRetryRecovers is event-driven and needs no fast tick.

🤖 Generated with Claude Code

Add an evetestkit suite exercising volume-delete retry behavior on a
kubevirt/longhorn EVE-k node: a failed volume destroy must be retained
and retried rather than unpublished and leaked, and a permanently-failing
delete must be given up on after a bounded number of retries.

The suite deploys a tiny VM app, waits for its volume to reach the Created
sub-state, then arms a fault on the device (a marker file consumed by EVE's
build-tagged volume-delete fault injection) and deletes the app.
TestVolumeDeleteRetryRecovers asserts the VolumeStatus stays published in
the Deleting sub-state with an error and then disappears once the fault is
cleared; TestVolumeDeleteGivesUp asserts it disappears after the retry
budget is exhausted while the fault persists.

Requires an EVE-k image built with FAULT_INJECTION=y and the volumemgr
delete-retry fix (lf-edge/eve#6176). Volume state is read directly off the
device (/run/volumemgr/VolumeStatus) because controller-reported state lags.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant