kaiyaok2 opened a new pull request, #6785:
URL: https://github.com/apache/hadoop/pull/6785

   ### Description of PR
   As described in https://issues.apache.org/jira/browse/MAPREDUCE-7475: 2 
tests are not idempotent and fails upon repeated execution within the same JVM 
instance due to self-induced state pollution. Specifically, these tests try to 
make the directory `TEST_ROOT_DIR` and write to it. The tests do not clean up 
(remove) the directory after execution. Therefore, in the second execution, 
`TEST_ROOT_DIR` would already exist and the exception `Could not create test 
dir` would be thrown. The tests shall be fixed as unit tests shall be 
idempotent.
   
   Below are the 2 non-idempotent tests:
   
   * `org.apache.hadoop.mapred.TestOldCombinerGrouping.testCombiner`
   * `org.apache.hadoop.mapreduce.TestNewCombinerGrouping.testCombiner`
   
   ##Sample Failure Message for 
`org.apache.hadoop.mapreduce.TestNewCombinerGrouping.testCombiner` (in the 2nd 
run of the test):
   ```
   java.lang.RuntimeException: Could not create test dir: 
/home/kaiyaok2/NIOExperiments/github.com/apache/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/build/test/data/e4ee268d-2946-43a2-93b5-f2b4ac647279
           at 
org.apache.hadoop.mapreduce.TestNewCombinerGrouping.testCombiner(TestNewCombinerGrouping.java:109)
           at java.base/java.lang.reflect.Method.invoke(Method.java:568)
   ```
   
   ### How was this patch tested?
   After the patch, rerunning the tests in the same JVM does not produce any 
exceptions.
   
   ### Code changes:
   Check if the test directory already exists (and delete it if so) before 
calling `mkdirs()`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to