Bridgewater / scala-notebook

Interactive Scala REPL in a browser
Other
742 stars 155 forks source link

Tests fail #5

Closed copumpkin closed 11 years ago

copumpkin commented 11 years ago

This makes the travis badge look really sad, and is probably bad for other reasons too.

Furthermore, some tests appear to actually hang, on travis at least. It's hard to say which given the noisy output, but someone might be able to parse https://travis-ci.org/copumpkin/scala-notebook/builds/5490351 better than I can.

MasseGuillaume commented 11 years ago

remote actors refuse to connect

REMOTE: RemoteClientError@akka://RemoteProcess@127.0.0.1:38777: Error[java.net.ConnectException:Connection refused 536 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

krisher commented 11 years ago

Setting 'fork in Test in ThisBuild := false,' in SBT seems to allow the subprocess tests to pass. Not clear what is going on yet.

-- Reminiscent of a classpath issue that I have seen before, my guess is that 'forked' VMs are not starting with the right CP. (Subprocess makes a weak attempt to use the classpath of the host VM when spawning new VMs for kernel processes)

copumpkin commented 11 years ago

These are the parameters my VMs are running with, if that helps:

pumpkin        56398   0.0  2.0  2954632  82016 s004  S+   11:50PM   0:04.04 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx265093120 -server com.bwater.notebook.kernel.pfork.ChildProcessMain com.bwater.notebook.kernel.remote.RemoteProcess 59428 0 akka://MySpec@127.0.0.1:59427/user/$b/$a /Users/pumpkin/Sandbox/Scala/scala-notebook/./.akka-cookie
pumpkin        56396   0.0  2.0  3008820  85744 s004  S+   11:50PM   0:05.31 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx256M -XX:MaxPermSize=128M -classpath /Users/pumpkin/Sandbox/Scala/scala-notebook/subprocess/target/scala-2.9.1/test-classes:/Users/pumpkin/Sandbox/Scala/scala-notebook/subprocess/target/scala-2.9.1/classes:/Users/pumpkin/.sbt/boot/scala-2.9.1/lib/scala-library.jar:/Users/pumpkin/.ivy2/cache/com.typesafe.akka/akka-remote/jars/akka-remote-2.0.2.jar:/Users/pumpkin/.ivy2/cache/com.typesafe.akka/akka-actor/jars/akka-actor-2.0.2.jar:/Users/pumpkin/.ivy2/cache/io.netty/netty/bundles/netty-3.3.0.Final.jar:/Users/pumpkin/.ivy2/cache/com.google.protobuf/protobuf-java/jars/protobuf-java-2.4.1.jar:/Users/pumpkin/.ivy2/cache/net.debasishg/sjson_2.9.1/jars/sjson_2.9.1-0.15.jar:/Users/pumpkin/.ivy2/cache/net.databinder/dispatch-json_2.9.1/jars/dispatch-json_2.9.1-0.8.5.jar:/Users/pumpkin/.ivy2/cache/org.apache.httpcomponents/httpclient/jars/httpclient-4.1.jar:/Users/pumpkin/.ivy2/cache/org.apache.httpcomponents/httpcore/jars/httpcore-4.1.jar:/Users/pumpkin/.ivy2/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar:/Users/pumpkin/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.4.jar:/Users/pumpkin/.ivy2/cache/org.objenesis/objenesis/jars/objenesis-1.2.jar:/Users/pumpkin/.ivy2/cache/commons-io/commons-io/jars/commons-io-1.4.jar:/Users/pumpkin/.ivy2/cache/voldemort.store.compress/h2-lzf/jars/h2-lzf-1.0.jar:/Users/pumpkin/.ivy2/cache/com.typesafe.akka/akka-slf4j/jars/akka-slf4j-2.0.2.jar:/Users/pumpkin/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar:/Users/pumpkin/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.4.jar:/Users/pumpkin/.ivy2/cache/log4j/log4j/bundles/log4j-1.2.16.jar:/Users/pumpkin/.ivy2/cache/org.apache.commons/commons-exec/jars/commons-exec-1.1.jar:/Users/pumpkin/.ivy2/cache/com.typesafe.akka/akka-testkit/jars/akka-testkit-2.0.2.jar:/Users/pumpkin/.ivy2/cache/org.scalatest/scalatest_2.9.1/jars/scalatest_2.9.1-1.8.jar:/Users/pumpkin/.sbt/boot/scala-2.9.2/org.scala-sbt/sbt/0.12.1/test-agent-0.12.1.jar:/Users/pumpkin/.sbt/boot/scala-2.9.2/org.scala-sbt/sbt/0.12.1/test-interface-0.5.jar sbt.ForkMain 59423
pumpkin        56364   0.0  4.4  4770344 183552 s004  S+   11:50PM   0:19.09 /usr/bin/java -Xms1536m -Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=192m -jar /Users/pumpkin/Sandbox/Scala/scala-notebook/sbt-launch.jar
copumpkin commented 11 years ago

Looking at my log, I see (omitting stuff in between messages):

2013-03-14 23:50:42,653  INFO [RemoteProcess-akka.actor.default-dispatcher-1] (akka.actor.ActorSystemImpl) - REMOTE: RemoteServerStarted@akka://RemoteProcess@127.0.0.1:59432
2013-03-14 23:50:43,600 DEBUG [RemoteProcess-akka.actor.default-dispatcher-1] (LocalActorRefProvider(akka://RemoteProcess)) - Received command [DaemonMsgCreate(Props(<function0>,akka.actor.default-dispatcher,NoRouter,Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka://RemoteProcess@127.0.0.1:59432))),Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka://RemoteProcess@127.0.0.1:59432)),akka://RemoteProcess@127.0.0.1:59432/remote/MySpec@127.0.0.1:59427/user/$c,Actor[akka://MySpec@127.0.0.1:59427/user])] to RemoteSystemDaemon on [akka://RemoteProcess]
2013-03-14 23:50:43,606  INFO [RemoteProcess-akka.actor.default-dispatcher-2] (com.bwater.notebook.kernel.remote.SingleVM$$anonfun$1$$anon$1$$anonfun$postStop$1$$anon$2) - Shutting down VM
2013-03-14 23:50:43,550  INFO [MySpec-akka.actor.default-dispatcher-1] (com.bwater.notebook.kernel.remote.SingleVM) - Shutting down remote VM: akka://RemoteProcess@127.0.0.1:59432
2013-03-14 23:50:44,011 DEBUG [MySpec-akka.actor.default-dispatcher-4] (RemoteClient(akka://MySpec)) - [PassiveRemoteClient@akka://RemoteProcess@127.0.0.1:59432] has been shut down
2013-03-14 23:50:49,594 ERROR [MySpec-akka.actor.default-dispatcher-4] (akka.actor.ActorSystemImpl) - REMOTE: RemoteClientError@akka://RemoteProcess@127.0.0.1:59432: Error[java.net.ConnectException:Connection refused

followed by all the errors. So it decides to shut down the remote actor on 59432 (it starts up another one on 59437 in between) and then tries to connect to it anyway, and barfs when it can't.

krisher commented 11 years ago

Well, have them passing in Scala-IDE test runner by passing host VM boot classpath to spawned processes (this is how scala-library is set here), but does not help with SBT.

krisher commented 11 years ago

Dan, I don't see the scala-compiler jar on your classpath. This would cause a failure while initializing the kernel actor in the spawned VM, and probably cause it to be shut down.

copumpkin commented 11 years ago

Yep! and aha! http://doc.akka.io/docs/akka/2.1.0/dev/multi-jvm-testing.html

krisher commented 11 years ago

Nevermind last comment, subprocess tests do not use the compiler... Saw the Akka SBT thing, purpose is to launch multiple VMs from sbt, but we need to dynamically spawn w/o SBT.

copumpkin commented 11 years ago

Yeah, I guess not :( grr!

KenCoder commented 11 years ago

Tests now passing in master (2.9) branch