Skip to content

Instantly share code, notes, and snippets.

@ijuma
Created Oct 29, 2012
Embed
What would you like to do?
SBT hang with forked tests
Exception in thread "Thread-18" Exception in thread "main" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2571)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:52)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:66)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.react$1(ForkTests.scala:56)
at sbt.ForkTests$$anonfun$apply$2$Acceptor$2$.run(ForkTests.scala:84)
at java.lang.Thread.run(Thread.java:722)
java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:328)
at scala.collection.immutable.Nil$.head(List.scala:325)
@ijuma
Copy link
Author

ijuma commented Oct 29, 2012

And the stacktrace before the user code is invoked:

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.scalatest.tools.ScalaTestFramework$ScalaTestRunner.run(ScalaTestFramework.scala:201)
at sbt.ForkMain$Run.run(ForkMain.java:135)
at sbt.ForkMain.main(ForkMain.java:70)

@vigdorchik
Copy link

vigdorchik commented Oct 29, 2012

The later exception looks like it is coming from ScalaTestRunner.run, no? Sbt doesn't provide guards against frameworks throwing exceptions.

@harrah
Copy link

harrah commented Oct 29, 2012

That stack trace is interesting for another reason. It looks like we're hit by the tailrec bug. react is annotated with tailrec:

https://github.com/harrah/xsbt/blob/0.12.1/main/actions/ForkTests.scala#L52

but the trace above shows it isn't optimized into a loop.

@harrah
Copy link

harrah commented Oct 29, 2012

@vigdorchik I don't see why it is ok for sbt to avoid responsibility for handling exceptions from the test framework, especially if the error message that the user sees is the one in this gist, which gives no indication what the problem is. Are you saying that the new code provides a better error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment