Scalac:在IDEA中运行Scalatest时断言失败

时间:2014-06-11 14:13:12

标签: scala intellij-idea apache-spark jetbrains-ide

我在Intellij IDEA中运行ScalaTest Suite,在scala测试之前的make阶段,我遇到了这个问题:

Error:scalac: Error: assertion failed: List(object package$DebugNode, object package$DebugNode)
      java.lang.AssertionError: assertion failed: List(object package$DebugNode, object package$DebugNode)
       at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1678)
       at scala.reflect.internal.Symbols$ClassSymbol.companionModule0(Symbols.scala:2988)
       at scala.reflect.internal.Symbols$ClassSymbol.companionModule(Symbols.scala:2991)
       at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1371)
       at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)
       at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
       at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
       at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
       at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
       at xsbt.CachedCompiler0.run(CompilerInterface.scala:126)
       at xsbt.CachedCompiler0.run(CompilerInterface.scala:102)
       at xsbt.CompilerInterface.run(CompilerInterface.scala:27)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:102)
       at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:48)
       at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
       at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:28)
       at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:25)
       at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:64)
       at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:22)
       at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:606)
       at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

由于增量编译,它是否是一个jetbrains错误?或者它与我运行的测试套件有关?堆栈跟踪中的任何信息都与我测试的TestSuite /项目无关。

2 个答案:

答案 0 :(得分:4)

我认为由于Interllij IDEA增量编译而导致错误。当我第一次构建Spark时,我遇到了同样的错误。

我去了偏好> Scala,通过SBT增量编译器设置Incrmental编译,名称Hasing:默认,编译顺序:混合。重新编译代码,一切都很好。

答案 1 :(得分:0)

我以前遇到过这样的问题,因为我在命令中构建了spark然后导入到IDEA中,重建会看到两个错误,解决它很容易,只需运行" mvn clean"在命令行中的spark的根文件夹下,然后在IDEA再次生成,错误就消失了。

TestSQLContext.scala断言失败的详细信息参考:http://www.dataguru.cn/thread-537920-1-1.html

以及关于Linux上的build spark 1.4.1的更多细节参考:http://www.dataguru.cn/thread-539343-1-1.html

fredericyuan