Hadoop Common
  1. Hadoop Common
  2. HADOOP-7357

hadoop.io.compress.TestCodec#main() should exit with non-zero exit code if test failed

    Details

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

      Description

      It's convenient to run something like

      HADOOP_CLASSPATH=hadoop-test-0.20.2.jar bin/hadoop org.apache.hadoop.io.compress.TestCodec  -count 3 -codec fo
      

      but the error code it returns isn't interesting.

      1-line patch attached fixes that.

      1. HADOOP-7357.patch.txt
        0.6 kB
        Philip Zeyliger
      2. HADOOP-7357-v2.patch.txt
        1 kB
        Philip Zeyliger
      3. hadoop-7357-3.patch
        2 kB
        Eli Collins

        Activity

        Hide
        Todd Lipcon added a comment -

        Why not get rid of the try/catch completely and just let the exception propagate out of main? That would produce the correct error code as well and remove 5 lines of code.

        Show
        Todd Lipcon added a comment - Why not get rid of the try/catch completely and just let the exception propagate out of main? That would produce the correct error code as well and remove 5 lines of code.
        Hide
        Aaron T. Myers added a comment -

        Hi Philip,

        This patch won't apply as-is. Looks to me like you generated it using `git show'. Please regenerate the patch using `git diff'.

        Show
        Aaron T. Myers added a comment - Hi Philip, This patch won't apply as-is. Looks to me like you generated it using `git show'. Please regenerate the patch using `git diff'.
        Hide
        Aaron T. Myers added a comment -

        I take it all back! `patch' is smarter than I gave it credit for.

        Show
        Aaron T. Myers added a comment - I take it all back! `patch' is smarter than I gave it credit for.
        Hide
        Philip Zeyliger added a comment -

        Removing the entire try catch, as per Todd's suggestion.

        Show
        Philip Zeyliger added a comment - Removing the entire try catch, as per Todd's suggestion.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12481384/HADOOP-7357.patch.txt
        against trunk revision 1130833.

        +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 passed core unit tests.

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

        Test results: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//testReport/
        Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//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/12481384/HADOOP-7357.patch.txt against trunk revision 1130833. +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 passed core unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//testReport/ Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/570//console This message is automatically generated.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12481388/HADOOP-7357-v2.patch.txt
        against trunk revision 1130833.

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

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

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/571//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/12481388/HADOOP-7357-v2.patch.txt against trunk revision 1130833. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/571//console This message is automatically generated.
        Hide
        Todd Lipcon added a comment -

        Can you re-upload latest patch with --no-prefix?

        Show
        Todd Lipcon added a comment - Can you re-upload latest patch with --no-prefix?
        Hide
        Eli Collins added a comment -

        Updated patch attached. Added missing throws clause in main.

        Show
        Eli Collins added a comment - Updated patch attached. Added missing throws clause in main.
        Hide
        Eli Collins added a comment -

        +1 to Phil's latest patch (w/ my small update). Here are test-patch results:

        +1 overall.  
        
            +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 system test framework.  The patch passed system test framework compile.
        
        Show
        Eli Collins added a comment - +1 to Phil's latest patch (w/ my small update). Here are test-patch results: +1 overall. +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 system test framework. The patch passed system test framework compile.
        Hide
        Eli Collins added a comment -

        I've committed this. Thanks Phil!

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

        Integrated in Hadoop-Common-trunk-Commit #730 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/730/)
        HADOOP-7357. hadoop.io.compress.TestCodec#main() should exit with non-zero exit code if test failed. Contributed by Philip Zeyliger

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

        • /hadoop/common/trunk/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #730 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/730/ ) HADOOP-7357 . hadoop.io.compress.TestCodec#main() should exit with non-zero exit code if test failed. Contributed by Philip Zeyliger eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1156839 Files : /hadoop/common/trunk/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common/src/test/java/org/apache/hadoop/io/compress/TestCodec.java

          People

          • Assignee:
            Philip Zeyliger
            Reporter:
            Philip Zeyliger
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development