Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1092665

Summary: RespawnTestCase occasionally stuck on Windows
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: TestsuiteAssignee: Jan Martiska <jmartisk>
Status: CLOSED NOTABUG QA Contact: Pavel Jelinek <pjelinek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: cdewolf, jmartisk, rhatlapa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-28 09:38:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Thread dump none

Description Petr Kremensky 2014-04-29 17:03:58 UTC
Description of problem:
 org.jboss.as.test.integration.respawn.RespawnTestCase occasionally stuck on Windows.

Version-Release number of selected component (if applicable):
 EAP 6.3.0.ER2

Thread dump:
"main@1" prio=5 tid=0x1 nid=NA runnable
   java.lang.Thread.State: RUNNABLE
 	  at java.io.FileInputStream.readBytes(FileInputStream.java:-1)
 	  at java.io.FileInputStream.read(FileInputStream.java:272)
 	  at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
 	  at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
 	  - locked <0x757> (a java.io.BufferedInputStream)
 	  at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
 	  at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
 	  at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
 	  - locked <0x758> (a java.io.InputStreamReader)
 	  at java.io.InputStreamReader.read(InputStreamReader.java:184)
 	  at java.io.BufferedReader.fill(BufferedReader.java:154)
 	  at java.io.BufferedReader.readLine(BufferedReader.java:317)
 	  at java.io.BufferedReader.readLine(BufferedReader.java:382)
 	  at org.jboss.as.test.integration.respawn.RespawnTestCase$ProcessUtil.listProcesses(RespawnTestCase.java:614)
 	  at org.jboss.as.test.integration.respawn.RespawnTestCase$ProcessUtil.getRunningProcesses(RespawnTestCase.java:586)
 	  at org.jboss.as.test.integration.respawn.RespawnTestCase.waitForProcesses(RespawnTestCase.java:503)
 	  at org.jboss.as.test.integration.respawn.RespawnTestCase.waitForAllProcesses(RespawnTestCase.java:489)
 	  at org.jboss.as.test.integration.respawn.RespawnTestCase.testDomainRespawn(RespawnTestCase.java:200)
 	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
 	  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:47)
 	  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 	  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
 	  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 	  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
 	  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
 	  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 	  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
 	  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
 	  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
 	  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
 	  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
 	  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 	  at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
 	  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
 	  at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:234)
 	  at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:133)
 	  at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:114)
 	  at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
 	  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:188)
 	  at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:166)
 	  at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
 	  at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:101)
 	  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Additional info:
 - It is not a functional error of EAP. Testsuite stuck in listProcesses() method.
 - https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-61-as-testsuite-Win-matrix-RespawnTestCase/jdk=java17_default,label_exp=w2k8%26%26x86/4/console

Comment 1 Petr Kremensky 2014-04-29 17:06:11 UTC
Created attachment 890867 [details]
Thread dump

Comment 2 Pavel Jelinek 2014-04-30 06:52:19 UTC
It breaks AS testsuite when it happens.

Comment 3 Jan Martiska 2014-05-22 08:29:43 UTC
My thoughts:
Maybe the OS' native buffer of a jps process' stdout/stderr overflows so the subprocess cannot do any more output and blocks. But there is nothing written into stderr, and stdout is very short, I don't see why it would fill the buffer. Furthermore, the jps process seems to be already finished when the deadlock happens.
So it kinda looks like for some reason, Windows doesn't pass the end-of-stream character in some cases even though the subprocess is finished. Wonder where it gets lost.

Comment 4 Jan Martiska 2014-05-27 12:45:57 UTC
Switching from Runtime.exec to a ProcessBuilder and redirecting the process' output to a file (and reading the output from that file afterwards) seems to resolve it for me. It is quite nasty though.

Comment 5 Jan Martiska 2014-05-27 14:16:41 UTC
.. that uses java 7 api :( 
Will try to find something else.

Comment 6 Jan Martiska 2014-05-28 09:38:12 UTC
It seems to be an issue with Samba shares and happens when the testsuite is run against a network-shared JDK distribution. The workaround is to use a local JDK distro, then it should work.

Comment 7 JBoss JIRA Server 2014-05-28 09:39:11 UTC
Jan Martiska <jmartisk> updated the status of jira JBQA-10007 to Closed