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

Ahmed Hussein commented on HDFS-15126:
--------------------------------------

{quote}I went over this class and this is a little hard to debug.
Basically, this goes into a wait for that if it fails it does not say anything 
but fail the assert.
I would propose one of the two following options:
Log the timeout for the function.
Add a message in the assertTrue to say what happened.{quote}

[~inigoiri], I agree with you. It was hard to debug the JUnit.
Actually, I used logs and I used JStack to figure out what was going on. My 
conclusion is that the test case fails when the execution of the JVM slows 
down. As a result the 2 seconds may expire before the report is sent.
I did not find something suspicious in the stack that reveals a deadlock or 
indefinite hold to the locks.
The slow down could be caused by scheduling decision of the OS or GC suspending 
some threads for a short time of period. Taking into consideration that the 
pre-commit build runs JUnit tests concurrently, then another possibility is 
that each JUnit will suffer a little bit of slow down due to CPU and concurrent 
processes running other JUnit tests.
I increased the timeout period and then I ran the Unit test in a loop. The test 
never failed after I increased the timeout to 6 seconds.

Can you please take a look at the patch? It is a very simple change.


> testForcedRegistration fails Intermittently
> -------------------------------------------
>
>                 Key: HDFS-15126
>                 URL: https://issues.apache.org/jira/browse/HDFS-15126
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ahmed Hussein
>            Assignee: Ahmed Hussein
>            Priority: Major
>         Attachments: HDFS-15126.001.patch
>
>
> Recently, {{TestDatanodeRegistration.testForcedRegistration}} started to fail 
> in the recommit builds:
> {code:bash}
> [ERROR] Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 
> 25.333 s <<< FAILURE! - in org.apache.hadoop.hdfs.TestDatanodeRegistration
> [ERROR] 
> testForcedRegistration(org.apache.hadoop.hdfs.TestDatanodeRegistration)  Time 
> elapsed: 11.39 s  <<< FAILURE!
> java.lang.AssertionError
>       at org.junit.Assert.fail(Assert.java:86)
>       at org.junit.Assert.assertTrue(Assert.java:41)
>       at org.junit.Assert.assertTrue(Assert.java:52)
>       at 
> org.apache.hadoop.hdfs.TestDatanodeRegistration.testForcedRegistration(TestDatanodeRegistration.java:385)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to