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

Eli Collins commented on HDFS-2967:
-----------------------------------

I've seen cases where this is not true, eg as Colin mentioned re-running after 
a Ctrl-C and some tests (eg when run via eclipse) that put data in directories 
that doesn't get cleared out.
                
> unit tests which alter persistent state should call cleanup before running
> --------------------------------------------------------------------------
>
>                 Key: HDFS-2967
>                 URL: https://issues.apache.org/jira/browse/HDFS-2967
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Colin Patrick McCabe
>            Priority: Minor
>
> I did a little test, and found that aborting unit tests halfway through (for 
> example, with the stop button in Eclipse) will NOT invoke the @After 
> functions.
> Needless to say, this could have bad consequences for test users.  A 
> developer might press control-C in the middle of a unit test, and then find 
> that he was unable to successfully re-run that test again because of the 
> lingering state.  A Jenkins build machine might experience a JVM crash 
> because of an out-of-memory condition, and then find that all builds turned 
> red because a unit test failed to clean up the state which it created.
> I think that in HDFS tests which alter persistent state, we probably should 
> invoke the @After functions from a @Before function, just to make sure that 
> the necessary cleanup is done.  Otherwise, we might be risking unrepeatable 
> test failures.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to