[ 
https://issues.apache.org/jira/browse/HBASE-7960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13596810#comment-13596810
 ] 

stack commented on HBASE-7960:
------------------------------

-    String root_dir = test_util.getDataTestDir("TestHalfStoreFile").toString();
+    String root_dir = TEST_UTIL.getDataTestDir("TestHalfStoreFile").toString();

Doesn't each test get its own dir (it's name is UUID).  The above creating a 
TestHalfStoreFile in the UUID dir seems too much/unnecessary.  Just do 
getDataTestDir().

{code}
 43   /**
 42    * @return Where to write test data on local filesystem, specific to
 41    *  the test.  Useful for tests that do not use a cluster.
 40    * Creates it if it does not exist already.
 39    * @see #getTestFileSystem()
 38    */
 37   public Path getDataTestDir() {
 36     if (this.dataTestDir == null){
 35       setupDataTestDir();
 34     }
 33     return new Path(this.dataTestDir.getAbsolutePath());
 32   }
 31
 30   /**
 29    * @param subdirName
 28    * @return Path to a subdirectory named <code>subdirName</code> under
 27    * {@link #getDataTestDir()}.
 26    * Does *NOT* create it if it does not exist.
 25    */
 24   public Path getDataTestDir(final String subdirName) {
 23     return new Path(getDataTestDir(), subdirName);
 22   }
 21
 20   /**
 19    * Sets up a directory for a test to use.
 18    *
 17    * @return New directory path, if created.
 16    */
 15   protected Path setupDataTestDir() {
 14     if (this.dataTestDir != null) {
 13       LOG.warn("Data test dir already setup in " +
 12         dataTestDir.getAbsolutePath());
 11       return null;
 10     }
  9
  8     String randomStr = UUID.randomUUID().toString();
  7     Path testPath= new Path(getBaseTestDir(), randomStr);
  6
  5     this.dataTestDir = new File(testPath.toString()).getAbsoluteFile();
  4     this.dataTestDir.deleteOnExit();
  3     return testPath;
  2   }
{code}
                
> cleanup TestDir in TestHalfStoreFileReader
> ------------------------------------------
>
>                 Key: HBASE-7960
>                 URL: https://issues.apache.org/jira/browse/HBASE-7960
>             Project: HBase
>          Issue Type: Test
>          Components: test
>    Affects Versions: 0.96.0
>            Reporter: Liang Xie
>            Assignee: Liang Xie
>            Priority: Minor
>             Fix For: 0.98.0
>
>         Attachments: HBASE-7960.txt
>
>
> Folders are created under test-data directory without cleanup in some tests.
> They should be cleaned up.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to