我有sbt跨项目,我正在尝试运行test
和testOnly
命令来运行scala测试,目前我有jvm测试和本机测试,始终是jvm测试成功运行,而本机失败了得到这个例外有什么主意吗?
[IJ]> test
[info] Processing resources
[info] Linking (5527 ms)
[info] Discovered 2325 classes and 15319 methods
[info] JvmTest:
[info] name
[info] - should the name is set correctly in constructor
[info] JvmTest2:
[info] age
[info] - should be 28
[info] Run completed in 11 seconds, 488 milliseconds.
[info] Total number of tests run: 2
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[info] Optimizing (debug mode) (8718 ms)
[info] Generating intermediate code (1943 ms)
[info] Produced 68 files
[info] Compiling to native code (9007 ms)
[info] Linking native code (boehm gc) (538 ms)
[info] Starting process '/home/naseem/Documents/SFreely NEW/CrossCompilePlatforms3June/myProject/nativeUbuntu18/target/scala-2.11/myprojectnativeubuntu18-out' on port '30651'.
[error] Uncaught exception when running tests: java.io.InvalidClassException: sbt.testing.TaskDef; local class incompatible: stream classdesc serialVersionUID = -7417691495999416204, local class serialVersionUID = 2663134200025980977
[info] Run completed in 531 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] Error during tests:
[error] Forked test harness failed: java.net.SocketException: Connection reset
[error] at java.net.SocketInputStream.read(SocketInputStream.java:210)
[error] at java.net.SocketInputStream.read(SocketInputStream.java:141)
[error] at java.net.SocketInputStream.read(SocketInputStream.java:224)
[error] at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2631)
[error] at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2825)
[error] at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2895)
[error] at java.io.ObjectInputStream$BlockDataInputStream.skipBlockData(ObjectInputStream.java:2797)
[error] at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:2229)
[error] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1871)
[error] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1745)
[error] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2033)
[error] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1567)
[error] at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2278)
[error] at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:557)
[error] at java.lang.Throwable.readObject(Throwable.java:914)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.lang.reflect.Method.invoke(Method.java:498)
[error] at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
[error] at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
[error] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2060)
[error] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1567)
[error] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427)
[error] at sbt.React.react(ForkTests.scala:122)
[error] at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:76)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (myProjectNativeUbuntu18/nativetest:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 35 s, completed Jul 10, 2019 11:57:19 AM