[
https://issues.apache.org/jira/browse/HDFS-4391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13551741#comment-13551741
]
Konstantin Shvachko commented on HDFS-4391:
-------------------------------------------
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:
{code}
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)
{code}
I can reproduce it in eclipse debugger just by moving
{{testManyClosedSocketsInCache()}} ahead of other test cases in the code.
> TestDataTransferKeepalive fails when tests are executed in a certain order.
> ---------------------------------------------------------------------------
>
> Key: HDFS-4391
> URL: https://issues.apache.org/jira/browse/HDFS-4391
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: test
> Affects Versions: 3.0.0
> Reporter: Konstantin Shvachko
>
> TestDataTransferKeepalive if testKeepaliveTimeouts() is executed AFTER
> testManyClosedSocketsInCache().
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira