hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12610) Make test failure messages more verbose and supportable
Date Tue, 01 Dec 2015 16:09:11 GMT

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

Steve Loughran commented on HADOOP-12610:
-----------------------------------------

This stack trace is a duplicate of  HADOOP-12590; there's a patch there for which review should
be appreciated. And the failure has been reverted.

I do recognise that we are atrocious about providing diagnostics. What we see here is a worst-case
example: an exception being swallowed for no reason whatsoever

> Make test failure messages more verbose and supportable
> -------------------------------------------------------
>
>                 Key: HADOOP-12610
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12610
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Wei-Chiu Chuang
>            Assignee: Wei-Chiu Chuang
>            Priority: Minor
>              Labels: supportability
>
> I saw a test failure in TestCompressorDecompressor.testCompressorDecompressor
> with the output
> Error Message
> {noformat}
> testCompressorDecompressor error !!!java.lang.NullPointerException
> {noformat}
> Stacktrace
> {noformat}
> java.lang.AssertionError: testCompressorDecompressor error !!!java.lang.NullPointerException
> 	at org.junit.Assert.fail(Assert.java:88)
> 	at org.apache.hadoop.io.compress.TestCompressorDecompressor.testCompressorDecompressor(TestCompressorDecompressor.java:69)
> {noformat}
> However, this message does not expose the origin of the exception, nor does it print
the error message. This makes debugging impossible. I also found the similar practice exists
in multiple test files:
> {noformat}
> ~/hadoop/hadoop-common-project/hadoop-common ((c21a801...)) $ grep -r "fail(.*+ e" .|less
> ./src/test/java/org/apache/hadoop/net/TestNetworkTopologyWithNodeGroup.java:        fail("Expecting
IllegalArgumentException, but caught:" + e);
> ./src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java:      fail("Got unexpected
exception: " + e.getMessage());
> ./src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java:        fail("Got unexpected
exception: " + e.getMessage());
> ./src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java:      fail("Got unexpected
exception: " + e.getMessage());
> ./src/test/java/org/apache/hadoop/io/TestMapFile.java:      fail("testRename error "
+ ex);
> ./src/test/java/org/apache/hadoop/io/compress/snappy/TestSnappyCompressorDecompressor.java:
     fail("testSnappyDirectBlockCompression ex !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testCompressorDecompressor error !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testCompressorDecompressorWithExeedBufferLimit error !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
       fail("testZlibCompressorDecompressorWithConfiguration ex error " + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testZlibCompressDecompress ex !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testZlibDirectCompressDecompress ex !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testBuiltInGzipDecompressorExceptions npe error " + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("testBuiltInGzipDecompressorExceptions aioob error" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("invalid 0 and 1 byte in gzip stream" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("invalid 2 byte in gzip stream" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("invalid 3 byte in gzip stream" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/zlib/TestZlibCompressorDecompressor.java:
     fail("invalid 3 byte make hasExtraField" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/TestCompressorDecompressor.java:      fail("testCompressorDecompressor
error !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/TestCompressorDecompressor.java:      fail("testCompressorDecompressorWithExeedBufferLimit
error !!!" + ex);
> ./src/test/java/org/apache/hadoop/io/compress/TestBlockDecompressorStream.java:     
fail("unexpected IOException : " + e);
> ./src/test/java/org/apache/hadoop/io/compress/bzip2/TestBzip2CompressorDecompressor.java:
     fail("testBzip2CompressDecompress ex !!!" + ex);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail(""
+ e);
> ./src/test/java/org/apache/hadoop/util/bloom/BloomFilterCommonTester.java:          Assert.fail("error
ex !!!" + ex);
> ./src/test/java/org/apache/hadoop/util/TestShell.java:      fail("Expected an exception
with the text `" + expectedText + "`"
> ./src/test/java/org/apache/hadoop/util/TestShell.java:      fail("Expected an exception
with the text `" + expectedText + "`"
> ./src/test/java/org/apache/hadoop/tracing/SetSpanReceiver.java:      Assert.fail("timed
out to get expected spans: " + e.getMessage());
> ./src/test/java/org/apache/hadoop/tracing/SetSpanReceiver.java:      Assert.fail("interrupted
while waiting spans: " + e.getMessage());
> ./src/test/java/org/apache/hadoop/ipc/TestRPCCompatibility.java:      fail("Expected
version mismatch but got " + ex);
> ./src/test/java/org/apache/hadoop/ipc/TestRPC.java:        fail("Expecting HadoopIllegalArgumentException
but caught " + e);
> ./src/test/java/org/apache/hadoop/ipc/TestRPC.java:        fail("Expecting HadoopIllegalArgumentException
but caught " + e);
> ./src/test/java/org/apache/hadoop/ipc/TestRPC.java:        fail("Expecting HadoopIllegalArgumentException
but caught " + e);
> ./src/test/java/org/apache/hadoop/security/token/delegation/TestDelegationToken.java:
     Assert.fail("action did not throw " + except);
> {noformat}
> I am filing this JIRA to make failure messages more verbose and make debugging easier.
There are of course similar patterns in other part of Hadoop codebase, but I am starting with
this one because I do see test failures here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message