hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daryn Sharp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-1805) Some Tests in TestDFSShell can not shutdown the MiniDFSCluster on any exception/assertion failure. This will leads to fail other testcases.
Date Fri, 10 Jun 2011 14:30:58 GMT

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

Daryn Sharp commented on HDFS-1805:
-----------------------------------

I looked at the patch a bit more closely.  I noticed a few more issues, but it really looks
good.  I run this test all the time so I'm really looking forward to it's integration.

* {{cluster}} and {{conf}} should be marked with "final" to ensure that a test doesn't twiddle
these values and risk causing subsequent tests to fail.

* Please change psBackup{Out,Err} to be static finals initialized to System.{out,err}.  Tests
should not be responsible for manipulating the restore values, else it creates opportunities
for errors.  Then in the @After, unconditionally restore the values (paranoia is good).  Ie.
{code}
static final PrintStream psBackupOut = System.out;
static final PrintStream psBackupErr = System.err;
...
@After
public void CleanUpResources() {
  ...
  System.setOut(psBackupOut);
  System.setErr(psBackupErr);
  ...
}
{code}

* I think deleteFromFS can be replaced with {{FileUtil.fullyDeleteContents(fs, new Path("/"))}}

* {{testURIPaths}} is starting another {{MiniDFSCluter}} but it's never stopped.  Rather than
wrap a try around the whole test, should create another class field for a 2nd cluster and
tear it down in the @After if not null.  Tests can fire up a 2nd cluster if needed since it
looks like just {{testURIPaths}} needs a 2nd cluster.

> Some Tests in TestDFSShell can not shutdown the MiniDFSCluster on any exception/assertion
failure. This will leads to fail other testcases.
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1805
>                 URL: https://issues.apache.org/jira/browse/HDFS-1805
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>            Priority: Minor
>             Fix For: 0.23.0
>
>         Attachments: HDFS-1805-1.patch, HDFS-1805-2.patch, HDFS-1805-3.patch, HDFS-1805.patch
>
>
> Some test cases in TestDFSShell are not shutting down the MiniDFSCluster in finally.
> If any test assertion failure or exception can result in not shutting down this cluster.
Because of this other testcases will fail. This will create difficulty in finding the actual
testcase failures.
> So, better to shutdown the cluster in finally. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message