ScalaTest Eclipse Plugin: Leftover Threads

46 views
Skip to first unread message

Alex Boisvert

unread,
Oct 30, 2012, 12:25:49 PM10/30/12
to scalate...@googlegroups.com
I'm using the ScalaTest Eclipse Plugin and seeing leftover threads after running tests... here is an example,

"Thread-742" prio=10 tid=0x00007f3912084800 nid=0x5697 runnable [0x00007f387f89f000]
   java.lang.Thread.State: RUNNABLE
        at java.net.PlainSocketImpl.socketAvailable(Native Method)
        at java.net.AbstractPlainSocketImpl.available(AbstractPlainSocketImpl.java:478)
        - locked <0x00000007721a2bd8> (a java.net.SocksSocketImpl)
        at java.net.SocketInputStream.available(SocketInputStream.java:238)
        at sun.nio.cs.StreamDecoder.inReady(StreamDecoder.java:362)
        at sun.nio.cs.StreamDecoder.implReady(StreamDecoder.java:370)
        at sun.nio.cs.StreamDecoder.ready(StreamDecoder.java:184)
        - locked <0x00000007721a2d20> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.ready(InputStreamReader.java:195)
        at java.io.BufferedReader.ready(BufferedReader.java:456)
        - locked <0x00000007721a2d20> (a java.io.InputStreamReader)
        at scala.tools.eclipse.scalatest.ui.ScalaTestListener.run(ScalaTestListener.scala:83)
        at java.lang.Thread.run(Thread.java:722)

Installation details
  • Eclipse Juno Service Release 1 (build 20121004-1855)
  • Scala IDE for Eclipse 2.1.0.m2-2_09-201209130939-63e4f61
  • ScalaTest for Scala IDE 0.9.3
There leftover threads seem to be consuming CPU too ... after a few runs, my CPU is running close to 100%  on all cores.

Looks familiar?

alex

Chee Seng Chua

unread,
Oct 30, 2012, 8:44:57 PM10/30/12
to scalate...@googlegroups.com
Hi Alex, 

Thanks for reporting, I'll try to reproduce with same configuration as yours and see if I can solve it.  Will report back here the result.

Thanks!

Chee Seng


alex

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest

Alex Boisvert

unread,
Oct 31, 2012, 12:48:16 AM10/31/12
to scalate...@googlegroups.com
Ironically, since sending this email earlier today and restarting Eclipse,  I haven't been able to reproduce these runaway threads.  It may not be easy to reproduce on a different system.... I'll send an update if I see them again and try to isolate the conditions.

Chee Seng Chua

unread,
Oct 31, 2012, 1:23:52 AM10/31/12
to scalate...@googlegroups.com
Hi Alex, 

I am trying to reproduce the problem with no avail, only possible way is that the ScalaTest run does not complete, and you start another run.  The socket reporter should not be process intensive, as what it does is receive the event from the ScalaTest process (which is forked as new external process for each run) and update the UI.  Can you check if you see something like this in the Console View:-

Run completed in 5 seconds, 518 milliseconds.
Total number of tests run: 47
Suites: completed 14, aborted 0
Tests: succeeded 46, failed 1, ignored 0, pending 0, canceled 1
*** 1 TEST FAILED ***

If you don't see that it means that the external ScalaTest process is still running, and thus the socket thread is still running and wait for more events.

One possible improvement I can think of is always close the existing socket before starting a new run, that will kill the thread but it won't terminate the running external ScalaTest process, which could still running your tests.

Do update us if you are able to isolate the conditions.

Thanks!

Best Regards, 
Chee Seng
Reply all
Reply to author
Forward
0 new messages