5

我在 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/项目无关。

4

2 回答 2

4

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

我去了 Preferences > Scala,通过 SBT 增量编译器设置 Incrmental 编译,Name Hasing:默认,编译顺序:Mixed。重新编译代码,一切正常。

于 2014-09-10T09:05:21.613 回答
0

之前遇到过这样的问题,因为我在command里构建了spark,然后导入IDEA,rebuild会看到两个错误,解决很简单,在命令行中运行spark根目录下的“mvn clean”,然后再make在 IDEA 中,错误消失了。

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

有关在 Linux 上构建 spark 1.4.1 的更多详细信息,请参阅:http ://www.dataguru.cn/thread-539343-1-1.html

弗雷德里克元

于 2015-09-06T03:54:07.090 回答