infinitest/infinitest — Issue #68: Infinitest fails to find tests - java.exe hung
Author: nathanila
Created: 2011-12-16 22:59:49+00:00
State: open

I installed Infinitest into Eclipse via the update site on my Windows 7 64-bit machine. I edited and saved a file that has a JUnit test for it. The Eclipse status bar says "Infinitest [looking for tests]: (0%)". The status says "0 tests found so far". I noticed that Eclipse launched a java.exe process. This process is not doing anything. It might be hung. The command line for the process is...

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -mx256m org.infinitest.testrunner.TestRunnerProcess org.infinitest.testrunner.JUnit4Runner 3831

Every time I save, a new java.exe with a similar command line appears, uses a little CPU time and then does nothing. I took a stack trace and found the main thread blocked waiting for socket input.

"main" prio=6 tid=0x00e3a800 nid=0x1f08 runnable [0x010cf000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.(Unknown Source)
at org.infinitest.testrunner.TestRunnerProcess.main(TestRunnerProcess.java:96)

The socket is connected to a port that Eclipse has open. ObjectInputStream is blocked while trying to read the header.

I took a call stack dump of Eclipse and found these two threads with an Infinitest frame. I didn't find any call stacks with a socket in it. So, where did the thread that communicates via a socket go? I don't know. I don't know the code of Infinitest at all so I am not sure where to look next.

"Thread-14" prio=6 tid=0x0a842800 nid=0x1d14 runnable [0x0bfaf000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at org.infinitest.testrunner.ConsoleOutputProcessor.run(ConsoleOutputProcessor.java:50)
at java.lang.Thread.run(Unknown Source)

"Thread-13" prio=6 tid=0x0a840c00 nid=0x167c runnable [0x0beaf000]
java.lang.Thread.State: RUNNABLE
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at org.infinitest.testrunner.ConsoleOutputProcessor.run(ConsoleOutputProcessor.java:50)
at java.lang.Thread.run(Unknown Source)