-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
clean up database file after testing #5087
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create read/write database for testing | ||
pub fn create_test_rw_db() -> Arc<DatabaseEnv> { | ||
Arc::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, since we consumed the tempdir it never got cleaned up on drop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smol naming nit
crates/storage/db/src/lib.rs
Outdated
@@ -171,26 +172,76 @@ pub mod test_utils { | |||
/// Error during tempdir creation | |||
pub const ERROR_TEMPDIR: &str = "Not able to create a temporary directory."; | |||
|
|||
/// A database will delete the db dir when dropped. | |||
#[derive(Debug)] | |||
pub struct TestTempDatabase<DB> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rename this To TempDatabase instead
Codecov Report
... and 415 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump @joshieDo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, pending @joshieDo
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Each time the test is executed, it occupies 4GB of disk space, quickly depleting my disk.