You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Ja...@McAfee.com on 2013/11/13 13:48:51 UTC

why are tests disabled with -DskipTests during package build ?

Good day - 
I'm a newbie Hadoop user - I'm trying to build from the latest hadoop-2.2.0-src.tar.gz tarball, 
and the BUILDING.txt says: 
"
  * Use -DskipTests to skip tests when running the following Maven goals:
    'package',  'install', 'deploy' or 'verify'
"
Why is this ? Is it because tests will fail ? It would appear so - without the  -DskipTests option,
the maven build command I'm using:
       $  mvn package -Pdist,native,docs,src -DskipTests -Dtar  

fails with :

"
Results :

Failed tests:   testSocketIOWithTimeout(org.apache.hadoop.net.TestSocketIOWithTimeout)

Tests run: 2015, Failures: 1, Errors: 0, Skipped: 15
"

Why is it not an issue that this test fails ?  

How can I ensure the test  passes when the resulting package is installed ?  

I try running the command line in the log after the build with -DskipTests succeed:

Forking command line: /bin/sh -c cd /home/jason/work/3P/hadoop-2.2.0/src/hadoop-common-project/hadoop-common && /opt/jdk1.7.0_45/jre/bin/java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -jar /home/jason/work/3P/hadoop-2.2.0/src/hadoop-common-project/hadoop-common/target/surefire/surefirebooter6164738766838875687.jar /home/jason/work/3P/hadoop-2.2.0/src/hadoop-common-project/hadoop-common/target/surefire/surefire1646141947230873924tmp /home/jason/work/3P/hadoop-2.2.0/src/hadoop-common-project/hadoop-common/target/surefire/surefire_1465676543897623396354tmp
Running org.apache.hadoop.net.TestSocketIOWithTimeout
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.508 sec <<< FAILURE!
testSocketIOWithTimeout(org.apache.hadoop.net.TestSocketIOWithTimeout)  Time elapsed: 2350 sec  <<< FAILURE!
java.lang.AssertionError
                at org.junit.Assert.fail(Assert.java:92)
                at org.junit.Assert.assertTrue(Assert.java:43)
                at org.junit.Assert.assertTrue(Assert.java:54)
                at org.apache.hadoop.net.TestSocketIOWithTimeout.doIO(TestSocketIOWithTimeout.java:75)
                at org.apache.hadoop.net.TestSocketIOWithTimeout.testSocketIOWithTimeout(TestSocketIOWithTimeout.java:105)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:606)
                at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
                at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
                at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
                at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
                at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
                at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:606)
                at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
                at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
                at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
                at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
                at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


And I get output ending in :
5,1,org.apache.hadoop.net.TestSocketIOWithTimeout,testSocketIOWithTimeout(org.apache.hadoop.net.TestSocketIOWithTimeout),null,null,null
3,0001,2013-11-13 11:24:56\u002C892 INFO  net.TestSocketIOWithTimeout (TestSocketIOWithTimeout.java:doIO(73)) - Got SocketTimeoutException as expected after 1008 millis : 1000 millis timeout while waiting for channel to be ready for write. ch : sun.nio.ch.SinkChannelImpl@5e235b5d\n
3,0001,2013-11-13 11:24:57\u002C906 INFO  net.TestSocketIOWithTimeout (TestSocketIOWithTimeout.java:doIO(73)) - Got SocketTimeoutException as expected after 1002 millis : 1000 millis timeout while waiting for channel to be ready for read. ch : sun.nio.ch.SourceChannelImpl@2047efe7\n
3,0001,2013-11-13 11:24:59\u002C909 INFO  net.TestSocketIOWithTimeout (TestSocketIOWithTimeout.java:doIO(73)) - Got SocketTimeoutException as expected after 2002 millis : 2000 millis timeout while waiting for channel to be ready for read. ch : sun.nio.ch.SourceChannelImpl@2047efe7\n
3,0001,2013-11-13 11:25:00\u002C914 INFO  net.TestSocketIOWithTimeout (TestSocketIOWithTimeout.java:doWork(125)) - Got expection while reading as expected : Interruped while waiting for IO on channel sun.nio.ch.SourceChannelImpl@2047efe7. 0 millis timeout left.\n
6,1,org.apache.hadoop.net.TestSocketIOWithTimeout,testSocketIOWithTimeout(org.apache.hadoop.net.TestSocketIOWithTimeout),null,null,null
2,1,org.apache.maven.surefire.junit4.JUnit4Provider,org.apache.hadoop.net.TestSocketIOWithTimeout,null,null,null
Z,0,BYE!
$ echo $?
0

Does this mean the test passed or failed ?

This is when building on an x86_64 Linux CentOS 6.4 platform, with Oracle Java JDK 1.7.0_45 + 64-bit JRE -
I'm re-building because I need the  64-bit native libraries which seem not to be built or distributed by Apache.

I'm very dubious about using the resulting package without it having passed its test suite .

Any ideas how to run the test suite outside the build process after installation ?

Or how to run the individual TestSocketIOWithTimeout test and obtain some indication of its success or failure ?

Any help / ideas would be much appreciated.

Thanks & Regards,
Jason