Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2623

Update ClusterMapReduceTestCase to use MiniDFSCluster.Builder

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Looking at test class ClusterMapReduceTestCase it issues a warning that the dfsCluster = new MiniDFSCluster(conf, 2, reformatDFS, null); line of code is deprecated and MiniDFSCluster.Builder should be used instead. It notes that the current API will be phased out in version 24. I propose to update the test class to the most up to date code as it's referenced several places on the internet as an example of how to write a Hadoop Unit Test.

      1. MAPREDUCE-2623.r2.diff
        0.8 kB
        Harsh J
      2. MAPREDUCE-2623.r1.diff
        0.8 kB
        Harsh J

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #742 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/742/)
        MAPREDUCE-2623. Update ClusterMapReduceTestCase to use MiniDFSCluster.Builder. Contributed by Harsh J Chouraria

        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1147981
        Files :

        • /hadoop/common/trunk/mapreduce/CHANGES.txt
        • /hadoop/common/trunk/mapreduce/src/test/mapred/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #742 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/742/ ) MAPREDUCE-2623 . Update ClusterMapReduceTestCase to use MiniDFSCluster.Builder. Contributed by Harsh J Chouraria eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1147981 Files : /hadoop/common/trunk/mapreduce/CHANGES.txt /hadoop/common/trunk/mapreduce/src/test/mapred/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #747 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/747/)
        MAPREDUCE-2623. Update ClusterMapReduceTestCase to use MiniDFSCluster.Builder. Contributed by Harsh J Chouraria

        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1147981
        Files :

        • /hadoop/common/trunk/mapreduce/CHANGES.txt
        • /hadoop/common/trunk/mapreduce/src/test/mapred/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #747 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/747/ ) MAPREDUCE-2623 . Update ClusterMapReduceTestCase to use MiniDFSCluster.Builder. Contributed by Harsh J Chouraria eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1147981 Files : /hadoop/common/trunk/mapreduce/CHANGES.txt /hadoop/common/trunk/mapreduce/src/test/mapred/org/apache/hadoop/mapred/ClusterMapReduceTestCase.java
        Hide
        Eli Collins added a comment -

        I've committed this. Thanks Harsh!

        Show
        Eli Collins added a comment - I've committed this. Thanks Harsh!
        Hide
        Eli Collins added a comment -

        +1 looks good

        Show
        Eli Collins added a comment - +1 looks good
        Hide
        Harsh J added a comment -

        Failing test TestRecoveryManager does not seem to be related to the patch. It runs fine locally for me with patch applied:

        $ ant -Dtestcase=TestRecoveryManager test-core
        …
            [junit] Running org.apache.hadoop.mapred.TestRecoveryManager
            [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 273.575 sec
        …
        BUILD SUCCESSFUL
        Total time: 4 minutes 57 seconds
        

        It is probably timing out due to a high amount of time used.

        Show
        Harsh J added a comment - Failing test TestRecoveryManager does not seem to be related to the patch. It runs fine locally for me with patch applied: $ ant -Dtestcase=TestRecoveryManager test-core … [junit] Running org.apache.hadoop.mapred.TestRecoveryManager [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 273.575 sec … BUILD SUCCESSFUL Total time: 4 minutes 57 seconds It is probably timing out due to a high amount of time used.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12483950/MAPREDUCE-2623.r2.diff
        against trunk revision 1146517.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        -1 findbugs. The patch appears to introduce 1 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these core unit tests:
        org.apache.hadoop.cli.TestMRCLI
        org.apache.hadoop.fs.TestFileSystem
        org.apache.hadoop.mapred.TestRecoveryManager

        -1 contrib tests. The patch failed contrib unit tests.

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12483950/MAPREDUCE-2623.r2.diff against trunk revision 1146517. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. -1 findbugs. The patch appears to introduce 1 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these core unit tests: org.apache.hadoop.cli.TestMRCLI org.apache.hadoop.fs.TestFileSystem org.apache.hadoop.mapred.TestRecoveryManager -1 contrib tests. The patch failed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/475//console This message is automatically generated.
        Hide
        Harsh J added a comment -

        Looks like these tests pass on the trunk now, w/ patch:

        
            [junit] Running org.apache.hadoop.mapred.TestJobStatusPersistency
            [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 67.398 sec
            [junit] Running org.apache.hadoop.mapred.TestClusterMapReduceTestCase
            [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 64.65 sec
        
        

        Marking as PA.

        Show
        Harsh J added a comment - Looks like these tests pass on the trunk now, w/ patch: [junit] Running org.apache.hadoop.mapred.TestJobStatusPersistency [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 67.398 sec [junit] Running org.apache.hadoop.mapred.TestClusterMapReduceTestCase [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 64.65 sec Marking as PA.
        Hide
        Harsh J added a comment -

        Oops, forgot that reformat was a method flag.

        The test case TestJobStatusPersistence#testNonPersistence fails for me without the patch applied, for some reason. Still investigating that one.

        Show
        Harsh J added a comment - Oops, forgot that reformat was a method flag. The test case TestJobStatusPersistence#testNonPersistence fails for me without the patch applied, for some reason. Still investigating that one.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12483918/MAPREDUCE-2623.r1.diff
        against trunk revision 1139400.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these core unit tests:
        org.apache.hadoop.cli.TestMRCLI
        org.apache.hadoop.fs.TestFileSystem
        org.apache.hadoop.mapred.TestClusterMapReduceTestCase
        org.apache.hadoop.mapred.TestJobStatusPersistency

        -1 contrib tests. The patch failed contrib unit tests.

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12483918/MAPREDUCE-2623.r1.diff against trunk revision 1139400. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these core unit tests: org.apache.hadoop.cli.TestMRCLI org.apache.hadoop.fs.TestFileSystem org.apache.hadoop.mapred.TestClusterMapReduceTestCase org.apache.hadoop.mapred.TestJobStatusPersistency -1 contrib tests. The patch failed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/425//console This message is automatically generated.
        Hide
        Harsh J added a comment -

        (Saw it was unassigned, so picked it up!)

        This should cover the change. I ran TestJobName, which uses it, and it succeeded. Lets see if QA says the same…

        Show
        Harsh J added a comment - (Saw it was unassigned, so picked it up!) This should cover the change. I ran TestJobName , which uses it, and it succeeded. Lets see if QA says the same…

          People

          • Assignee:
            Harsh J
            Reporter:
            Jim Plush
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development