Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4391

TestDataTransferKeepalive fails when tests are executed in a certain order.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      TestDataTransferKeepalive if testKeepaliveTimeouts() is executed AFTER testManyClosedSocketsInCache().

        Activity

        Hide
        shv Konstantin Shvachko added a comment -

        JUnit does not guarantee the order of tests execution. So it does not always fail. If testManyClosedSocketsInCache() is executed last the test passes. But if goes first the next test testKeepaliveTimeouts() fails with the assertion:

        Running org.apache.hadoop.hdfs.TestDataTransferKeepalive
        Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.687 sec <<< FAILURE!
        testKeepaliveTimeouts(org.apache.hadoop.hdfs.TestDataTransferKeepalive)  Time elapsed: 702 sec  <<< FAILURE!
        java.lang.AssertionError: expected:<0> but was:<3>
        	at org.junit.Assert.fail(Assert.java:91)
        	at org.junit.Assert.failNotEquals(Assert.java:645)
        	at org.junit.Assert.assertEquals(Assert.java:126)
        	at org.junit.Assert.assertEquals(Assert.java:470)
        	at org.junit.Assert.assertEquals(Assert.java:454)
        	at org.apache.hadoop.hdfs.TestDataTransferKeepalive.testKeepaliveTimeouts(TestDataTransferKeepalive.java:95)
        	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:601)
        	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        	at org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28)
        

        I can reproduce it in eclipse debugger just by moving testManyClosedSocketsInCache() ahead of other test cases in the code.

        Show
        shv Konstantin Shvachko added a comment - JUnit does not guarantee the order of tests execution. So it does not always fail. If testManyClosedSocketsInCache() is executed last the test passes. But if goes first the next test testKeepaliveTimeouts() fails with the assertion: Running org.apache.hadoop.hdfs.TestDataTransferKeepalive Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.687 sec <<< FAILURE! testKeepaliveTimeouts(org.apache.hadoop.hdfs.TestDataTransferKeepalive) Time elapsed: 702 sec <<< FAILURE! java.lang.AssertionError: expected:<0> but was:<3> at org.junit.Assert.fail(Assert.java:91) at org.junit.Assert.failNotEquals(Assert.java:645) at org.junit.Assert.assertEquals(Assert.java:126) at org.junit.Assert.assertEquals(Assert.java:470) at org.junit.Assert.assertEquals(Assert.java:454) at org.apache.hadoop.hdfs.TestDataTransferKeepalive.testKeepaliveTimeouts(TestDataTransferKeepalive.java:95) 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:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.FailOnTimeout$1.run(FailOnTimeout.java:28) I can reproduce it in eclipse debugger just by moving testManyClosedSocketsInCache() ahead of other test cases in the code.
        Hide
        sureshms Suresh Srinivas added a comment -

        The test order also changes when we move to JDK7.

        Show
        sureshms Suresh Srinivas added a comment - The test order also changes when we move to JDK7.
        Hide
        shv Konstantin Shvachko added a comment -

        Yep, that's how I found it in the first place.

        Show
        shv Konstantin Shvachko added a comment - Yep, that's how I found it in the first place.
        Hide
        andrew.wang Andrew Wang added a comment -

        Fix attached. When testKeepaliveTimeouts() runs after a file is read by another test, the cache gets populated and the initial assert fails.

        Fix is to reset the cache for every test.

        Show
        andrew.wang Andrew Wang added a comment - Fix attached. When testKeepaliveTimeouts() runs after a file is read by another test, the cache gets populated and the initial assert fails. Fix is to reset the cache for every test.
        Hide
        hadoopqa Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12573141/hdfs-4391-1.patch
        against trunk revision .

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

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

        +1 tests included appear to have a timeout.

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

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +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 unit tests in hadoop-hdfs-project/hadoop-hdfs:

        org.apache.hadoop.hdfs.server.datanode.TestDataDirs

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/4075//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/4075//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12573141/hdfs-4391-1.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 tests included appear to have a timeout. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +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 unit tests in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.server.datanode.TestDataDirs +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/4075//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/4075//console This message is automatically generated.
        Hide
        andrew.wang Andrew Wang added a comment -

        Test failure unrelated, it's HDFS-4586.

        Show
        andrew.wang Andrew Wang added a comment - Test failure unrelated, it's HDFS-4586 .
        Hide
        atm Aaron T. Myers added a comment -

        +1, the patch looks good to me. The failed test is known to be failing on trunk, and is already tracked by HDFS-4586.

        I'm going to commit this momentarily.

        Show
        atm Aaron T. Myers added a comment - +1, the patch looks good to me. The failed test is known to be failing on trunk, and is already tracked by HDFS-4586 . I'm going to commit this momentarily.
        Hide
        atm Aaron T. Myers added a comment -

        I've just committed this to trunk.

        Thanks a lot for the contribution, Andrew.

        Show
        atm Aaron T. Myers added a comment - I've just committed this to trunk. Thanks a lot for the contribution, Andrew.
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-trunk-Commit #3448 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3448/)
        HDFS-4391. TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Show
        hudson Hudson added a comment - Integrated in Hadoop-trunk-Commit #3448 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3448/ ) HDFS-4391 . TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-Yarn-trunk #153 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/153/)
        HDFS-4391. TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Show
        hudson Hudson added a comment - Integrated in Hadoop-Yarn-trunk #153 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/153/ ) HDFS-4391 . TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1342 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1342/)
        HDFS-4391. TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343)

        Result = FAILURE
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Show
        hudson Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1342 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1342/ ) HDFS-4391 . TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343) Result = FAILURE atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Hide
        hudson Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1370 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1370/)
        HDFS-4391. TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343)

        Result = SUCCESS
        atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java
        Show
        hudson Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1370 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1370/ ) HDFS-4391 . TestDataTransferKeepalive fails when tests are executed in a certain order. Contributed by Andrew Wang. (Revision 1455343) Result = SUCCESS atm : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1455343 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/SocketCache.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDataTransferKeepalive.java

          People

          • Assignee:
            andrew.wang Andrew Wang
            Reporter:
            shv Konstantin Shvachko
          • Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development