Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Nov 20, 2024

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
Copy link
Collaborator Author

smklein commented Nov 20, 2024

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

Copy link
Contributor

@andrewjstone andrewjstone left a comment

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
16 checks passed
@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