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

clean up database file after testing #5087

Merged
merged 11 commits into from
Oct 25, 2023
Merged

clean up database file after testing #5087

merged 11 commits into from
Oct 25, 2023

Conversation

robinsdan
Copy link
Contributor

Each time the test is executed, it occupies 4GB of disk space, quickly depleting my disk.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

that makes sense,

1 q re Option field.

pending @joshieDo

crates/storage/db/src/lib.rs Show resolved Hide resolved
/// Create read/write database for testing
pub fn create_test_rw_db() -> Arc<DatabaseEnv> {
Arc::new(
Copy link
Collaborator

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

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

smol naming nit

@@ -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> {
Copy link
Collaborator

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

codecov bot commented Oct 19, 2023

Codecov Report

Merging #5087 (533c7d2) into main (4dc15c3) will increase coverage by 41.88%.
Report is 8 commits behind head on main.
The diff coverage is 79.31%.

❗ Current head 533c7d2 differs from pull request most recent head d359182. Consider uploading reports for the commit d359182 to get more accurate results

Impacted file tree graph

Files Coverage Δ
crates/blockchain-tree/src/blockchain_tree.rs 84.27% <100.00%> (+61.70%) ⬆️
crates/consensus/beacon/src/engine/sync.rs 81.89% <100.00%> (+56.26%) ⬆️
crates/consensus/beacon/src/engine/test_utils.rs 66.99% <ø> (+66.99%) ⬆️
crates/net/downloaders/src/bodies/bodies.rs 91.59% <100.00%> (+72.72%) ⬆️
crates/net/downloaders/src/bodies/task.rs 94.68% <100.00%> (+65.95%) ⬆️
...ates/net/downloaders/src/test_utils/file_client.rs 80.97% <100.00%> (+80.97%) ⬆️
crates/primitives/src/chain/spec.rs 97.87% <100.00%> (+77.90%) ⬆️
crates/stages/src/stages/bodies.rs 91.36% <100.00%> (+90.73%) ⬆️
crates/stages/src/test_utils/runner.rs 96.77% <100.00%> (+96.77%) ⬆️
crates/stages/src/test_utils/test_db.rs 85.19% <100.00%> (+85.19%) ⬆️
... and 5 more

... and 415 files with indirect coverage changes

Flag Coverage Δ
integration-tests 17.04% <0.00%> (-9.04%) ⬇️
unit-tests 62.11% <79.31%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 30.57% <ø> (+4.79%) ⬆️
blockchain tree 80.82% <100.00%> (+52.36%) ⬆️
pipeline 88.26% <85.71%> (+83.21%) ⬆️
storage (db) 74.58% <70.27%> (+44.61%) ⬆️
trie 94.96% <100.00%> (+72.43%) ⬆️
txpool 55.31% <ø> (+13.93%) ⬆️
networking 78.19% <100.00%> (+47.29%) ⬆️
rpc 57.97% <ø> (+31.49%) ⬆️
consensus 63.01% <100.00%> (+37.94%) ⬆️
revm 24.47% <ø> (+14.62%) ⬆️
payload builder 7.95% <ø> (-6.21%) ⬇️
primitives 84.77% <100.00%> (+55.60%) ⬆️

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending @joshieDo @rkrasiuk

@mattsse
Copy link
Collaborator

mattsse commented Oct 23, 2023

bump @joshieDo

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending @joshieDo

mattsse and others added 2 commits October 24, 2023 12:10
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
@mattsse mattsse added the C-test A change that impacts how or what we test label Oct 24, 2023
@mattsse mattsse added this pull request to the merge queue Oct 25, 2023
Merged via the queue into paradigmxyz:main with commit 6ca14b5 Oct 25, 2023
22 checks passed
@robinsdan robinsdan deleted the test branch October 26, 2023 02:31
Arindam2407 pushed a commit to Arindam2407/reth that referenced this pull request Oct 31, 2023
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
mattsse added a commit that referenced this pull request Nov 8, 2023
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test A change that impacts how or what we test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants