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

HIVE-15910: Improvements in Hive Unit Test by using In-memory Derby DB #147

Closed
wants to merge 1 commit into from

Conversation

sankarh
Copy link
Contributor

@sankarh sankarh commented Feb 14, 2017

No description provided.

@@ -102,6 +102,11 @@ protected CompactorTest() throws Exception {
tmpdir.deleteOnExit();
}

protected void deleteTableDir(String tableName) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just doing a org.apache.commons.io.FileUtils.deleteDirectory(tmpdir) before tmpdir.mkdir() would be a simple solution, as all files are being created under that dir. With that the individual deleteTableDir calls won't be needed.
Also, the path could be made unique by using Files.createTempDirectory, so that concurrent running of tests won't step on each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with temp directory creation using Files.createTempDirectory. With this, we can ensure both concurrent and repeated calls won't end up with same directory. Also, will delete the temp directory as part of tearDown itself to avoid creating too many directories.

@sankarh
Copy link
Contributor Author

sankarh commented Feb 21, 2017

Already committed to master.

@sankarh sankarh closed this Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants