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

Use the Test Name for the dbname when running unit tests #353

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

mrambacher
Copy link
Contributor

This PR is based on the following RocksDB PR.

The name of the database directory can be based on the name of the test itself. This allows multiple tests in the same test class to use different database directories rather than all going to the same or similar directories.

This change can also help in debugging and KEEP_DB tests, as the directory after the test run can be spotted by its name (which is based on the name of the test).

mrambacher added 2 commits May 5, 2022 13:42
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
@mrambacher mrambacher requested a review from Yuval-Ariel January 5, 2023 01:22
@mrambacher mrambacher self-assigned this Jan 5, 2023
@Yuval-Ariel
Copy link
Contributor

closes #273

@Yuval-Ariel Yuval-Ariel linked an issue Jan 6, 2023 that may be closed by this pull request
@Yuval-Ariel
Copy link
Contributor

atm, each suite running in the same process creates one dir and each test in it is using the same dir. these changes create dir for each test inside the suite which will create much more leftovers as can be seen in compaction_service_test. ( DestroyDB doesnt clean up the dir created by the remote compaction. )
i suggest we also add a better cleanup for successful tests

@mrambacher
Copy link
Contributor Author

atm, each suite running in the same process creates one dir and each test in it is using the same dir. these changes create dir for each test inside the suite which will create much more leftovers as can be seen in compaction_service_test. ( DestroyDB doesnt clean up the dir created by the remote compaction. ) i suggest we also add a better cleanup for successful tests

I agree the tests should do a better job of cleaning up after themselves. This PR is not about that at all however. It is meant to allow one to determine what test left what around. It is also ensures that the parallel tests use separate directories and can eliminate some of the other information (pid/tid, etc) that are built into the directory/DB names now. The goal would be to simplify the naming in a future PR.

@Yuval-Ariel
Copy link
Contributor

what i meant is this PR causes a huge increase in the leftovers (undeleted files and dirs in the test dir (rocksdbtest-1000)) which seems like a problem so it might be addressed here or in a subsequent PR but the point is to address it.

Copy link
Contributor

@Yuval-Ariel Yuval-Ariel left a comment

Choose a reason for hiding this comment

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

LGTM, just needs rewording of the commit msg and add the PR number

@Yuval-Ariel
Copy link
Contributor

fuzzer error doesnt seem to be related to the changes.

@Yuval-Ariel
Copy link
Contributor

@mrambacher , i've checked the size of the leftovers and heres what i found: (using the makefile)

parallel make check:
mrambacher:DBGTestName - 39Mb
main - 14Mb

serial make check (J=1)
mrambacher:DBGTestName - 400Mb
main - 160Mb

do you have an idea why theres a difference between the size of the leftovers of the serial run vs the parallel? could the parallel version not run all the tests that the serial does?

@Yuval-Ariel
Copy link
Contributor

just noticed that @isaac-io was working on it in isaac/test-cleanup

@Yuval-Ariel
Copy link
Contributor

we've agreed to add the test executable name before so that its easy to identify the suite to which an individual test belongs to.
for tests that inherit from DBTestBase, each test will now have the name such as: (e.g. the first test in db_basic_test suite)
db_basic_test-DBBasicTest.OpenWhenOpen_ProcessID_ThreadID

we've also agreed to address the cleanup only if the need arises.

@Yuval-Ariel
Copy link
Contributor

theres also a problem with the fuzzer caused by a running the CI on a branch that exists in a different repo. @maxb-io is on it.

@mrambacher
Copy link
Contributor Author

we've agreed to add the test executable name before so that its easy to identify the suite to which an individual test belongs to. for tests that inherit from DBTestBase, each test will now have the name such as: (e.g. the first test in db_basic_test suite) db_basic_test-DBBasicTest.OpenWhenOpen_ProcessID_ThreadID

we've also agreed to address the cleanup only if the need arises.

Adding the file name is more complex than I was hoping and I would like to address that in a subsequent PR where we potentially can also clean up the test name further.

@Yuval-Ariel
Copy link
Contributor

sure np

@Yuval-Ariel
Copy link
Contributor

just needs to be a single commit with a proper msg

@Yuval-Ariel
Copy link
Contributor

@mrambacher , can you fix this?

just needs to be a single commit with a proper msg

@Yuval-Ariel
Copy link
Contributor

on hold until commit msg is fixed

@Yuval-Ariel Yuval-Ariel merged commit 1d3804f into speedb-io:main Feb 7, 2023
ayulas pushed a commit that referenced this pull request Feb 26, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
Yuval-Ariel pushed a commit that referenced this pull request May 1, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
Yuval-Ariel pushed a commit that referenced this pull request May 4, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
udi-speedb pushed a commit that referenced this pull request Nov 13, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
udi-speedb pushed a commit that referenced this pull request Nov 15, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
udi-speedb pushed a commit that referenced this pull request Dec 4, 2023
Add a method that allows the test name to be part of the DB name.  This makes it easier to associate a given test run with a given test.  Otherwise, some of the tests will overwrite the old data from a previous test.
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.

Rebase 7.7.3 db_test bug - PurgeInfoLogs
2 participants