Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scoverage fails for multi-jvm tests #151

Open
hhimanshu opened this issue Nov 27, 2015 · 3 comments
Open

scoverage fails for multi-jvm tests #151

hhimanshu opened this issue Nov 27, 2015 · 3 comments

Comments

@hhimanshu
Copy link

My repository is https://github.com/hhimanshu/akka101

Harits-MacBook-Pro-2:akka101 harit$ sbt clean coverage test
[info] Loading project definition from /Users/harit/IdeaProjects/akka101/project
[info] Set current project to akka101 (in build file:/Users/harit/IdeaProjects/akka101/)
[success] Total time: 0 s, completed Nov 26, 2015 8:24:21 PM
[info] Set current project to akka101 (in build file:/Users/harit/IdeaProjects/akka101/)
[info] Updating {file:/Users/harit/IdeaProjects/akka101/}cluster_simple...
[info] Updating {file:/Users/harit/IdeaProjects/akka101/}akka101...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 2 Scala sources to /Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/classes...
[info] Reading scoverage instrumentation [/Users/harit/IdeaProjects/akka101/target/scala-2.11/scoverage-data/scoverage.coverage.xml]
[info] [info] Cleaning datadir [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-data]
[info] [info] Beginning coverage instrumentation
[info] [info] Instrumentation completed [31 statements]
[info] [info] Wrote instrumentation file [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-data/scoverage.coverage.xml]
[info] [info] Will write measurement data to [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-data]
[info] Compiling 1 Scala source to /Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/multi-jvm-classes...
[info] Reading scoverage instrumentation [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-data/scoverage.coverage.xml]
[info] Reading scoverage measurements...
[info] Generating scoverage reports...
[info] Written Cobertura report [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/coverage-report/cobertura.xml]
[info] Written XML coverage report [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-report/scoverage.xml]
[info] Written HTML coverage report [/Users/harit/IdeaProjects/akka101/cluster_simple/target/scala-2.11/scoverage-report/index.html]
[info] Coverage reports completed
[info] All done. Coverage was [0.00%]
[info] * SimpleClusterListenerSpec
[JVM-1] Run starting. Expected test count is: 2
[JVM-1] SimpleClusterListenerSpecMultiJvmNode1:
[JVM-2] Run starting. Expected test count is: 1
[JVM-2] SimpleClusterListenerSpecMultiJvmNode2:
[JVM-2] Uncaught error from thread [SimpleClusterListenerSpec-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[SimpleClusterListenerSpec]
[JVM-2] java.lang.NoClassDefFoundError: scoverage/Invoker$
[JVM-2]     at SimpleClusterListener.<init>(SimpleClusterListener.scala:8)
[JVM-2]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[JVM-2]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[JVM-2]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[JVM-2]     at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
[JVM-2]     at java.lang.Class.newInstance(Class.java:442)
[JVM-2]     at akka.util.Reflect$.instantiate(Reflect.scala:44)
[JVM-2]     at akka.actor.NoArgsReflectConstructor.produce(Props.scala:357)
[JVM-2]     at akka.actor.Props.newActor(Props.scala:259)
[JVM-2]     at akka.actor.ActorCell.newActor(ActorCell.scala:561)
[JVM-2]     at akka.actor.ActorCell.create(ActorCell.scala:587)
[JVM-2]     at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:460)
[JVM-2]     at akka.actor.ActorCell.systemInvoke(ActorCell.scala:482)
[JVM-2]     at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
[JVM-2]     at akka.dispatch.Mailbox.run(Mailbox.scala:223)
[JVM-2]     at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
[JVM-2]     at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[JVM-2]     at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[JVM-2]     at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[JVM-2]     at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[JVM-2] Caused by: java.lang.ClassNotFoundException: scoverage.Invoker$
[JVM-2]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[JVM-2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[JVM-2]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[JVM-2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[JVM-2]     ... 20 more
[JVM-1] Uncaught error from thread [SimpleClusterListenerSpec-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[SimpleClusterListenerSpec]
[JVM-1] java.lang.NoClassDefFoundError: scoverage/Invoker$
[JVM-1]     at SimpleClusterListener.<init>(SimpleClusterListener.scala:8)
[JVM-1]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[JVM-1]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[JVM-1]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[JVM-1]     at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
[JVM-1]     at java.lang.Class.newInstance(Class.java:442)
[JVM-1]     at akka.util.Reflect$.instantiate(Reflect.scala:44)
[JVM-1]     at akka.actor.NoArgsReflectConstructor.produce(Props.scala:357)
[JVM-1]     at akka.actor.Props.newActor(Props.scala:259)
[JVM-1]     at akka.actor.ActorCell.newActor(ActorCell.scala:561)
[JVM-1]     at akka.actor.ActorCell.create(ActorCell.scala:587)
[JVM-1]     at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:460)
[JVM-1]     at akka.actor.ActorCell.systemInvoke(ActorCell.scala:482)
[JVM-1]     at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
[JVM-1]     at akka.dispatch.Mailbox.run(Mailbox.scala:223)
[JVM-1]     at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[JVM-1] Caused by: java.lang.ClassNotFoundException: scoverage.Invoker$
[JVM-1]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[JVM-1]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[JVM-1]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[JVM-1]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[JVM-1]     ... 20 more
[JVM-1] [ERROR] [11/26/2015 20:24:36.904] [SimpleClusterListenerSpec-akka.actor.default-dispatcher-3] [akka.actor.ActorSystemImpl(SimpleClusterListenerSpec)] Uncaught error from thread [SimpleClusterListenerSpec-akka.actor.default-dispatcher-3] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
[JVM-1] java.lang.NoClassDefFoundError: scoverage/Invoker$
[JVM-1]     at SimpleClusterListener.<init>(SimpleClusterListener.scala:8)
[JVM-1]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[JVM-1]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[JVM-1]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[JVM-1]     at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
[JVM-1]     at java.lang.Class.newInstance(Class.java:442)
[JVM-1]     at akka.util.Reflect$.instantiate(Reflect.scala:44)
[JVM-1]     at akka.actor.NoArgsReflectConstructor.produce(Props.scala:357)
[JVM-1]     at akka.actor.Props.newActor(Props.scala:259)
[JVM-1]     at akka.actor.ActorCell.newActor(ActorCell.scala:561)
[JVM-1]     at akka.actor.ActorCell.create(ActorCell.scala:587)
[JVM-1]     at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:460)
[JVM-1]     at akka.actor.ActorCell.systemInvoke(ActorCell.scala:482)
[JVM-1]     at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
[JVM-1]     at akka.dispatch.Mailbox.run(Mailbox.scala:223)
[JVM-1]     at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[JVM-1]     at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[JVM-1] Caused by: java.lang.ClassNotFoundException: scoverage.Invoker$
[JVM-1]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[JVM-1]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[JVM-1]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[JVM-1]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[JVM-1]     ... 20 more
[JVM-1] 
[error] Failed: SimpleClusterListenerSpecMultiJvmNode1
[error] Failed: SimpleClusterListenerSpecMultiJvmNode2
[info] Run completed in 501 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[error] Failed tests:
[error]     SimpleClusterListenerSpec
[error] (cluster_simple/test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 16 s, completed Nov 26, 2015 8:24:37 PM
@DarkSlice1
Copy link

Same issue here, any plan on a fix?

@lmlynik
Copy link

lmlynik commented Aug 2, 2016

Anybody solved this?

@alonsodomin
Copy link

There is a workaround for this, just adding the scalac-scoverage-runtime artifact to the library dependencies fixes the problem:

"org.scoverage" %% "scalac-scoverage-runtime" % "1.1.1" % "multi-jvm"

SBT should resolve the depency anyway, since sbt-scoverage places the runtime and compiler plugin in the provided scope.

OlivierBlanvillain added a commit to OlivierBlanvillain/dotty that referenced this issue Feb 12, 2018
To keep the run tests runing one solution might be to add the following
on the test classpath:

"org.scoverage" %% "scalac-scoverage-runtime" % "1.1.1" % "multi-jvm"

(see scoverage/sbt-scoverage#151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants