Skip to content

[sled-storage] Automatically clean up test zpools, storage#7111

Merged
smklein merged 1 commit into
mainfrom
better-storage-harness
Nov 20, 2024
Merged

[sled-storage] Automatically clean up test zpools, storage#7111
smklein merged 1 commit into
mainfrom
better-storage-harness

Conversation

@smklein

@smklein smklein commented Nov 20, 2024

Copy link
Copy Markdown
Collaborator

StorageManagerTestHarness is a utility which allows sled agent tests to use real zpools and datasets atop temporary file-backed storage. This provides a decent test fidelity for storage-based parts of the sled agent.

This harness previously took a liberal attitude towards zpool creation, but a conservative perspective on their deletion: rather than automatically destroying zpools on test failure, it would print commands for "how to delete these zpools yourself". This tendency was mostly borne out of fear: deleting zpools is a dangerous operation which should be done with caution.

When working with the StorageManagerTestHarness, especially while iterating on tests with many expected failures, I've decided this is an Enormous Pain In The Butt. This PR changes the aforementioned tendency, and just attempts to delete all provisioned zpools we created in our tests. If we fail to do so, we'll then log an error message and let the user take responsibility for manual cleanup.

@smklein

smklein commented Nov 20, 2024

Copy link
Copy Markdown
Collaborator Author

Made this while working on #6782. IMO it's a nice quality-of-life improvement for development.

@andrewjstone andrewjstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice QOL improvement indeed.

@smklein smklein merged commit ce69e14 into main Nov 20, 2024
@smklein smklein deleted the better-storage-harness branch November 20, 2024 17:51
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.

2 participants