Strange scala.MatchError: None (of class scala.None$) with scalatest

1,078 views
Skip to first unread message

Alexey Kuznetsov

unread,
Nov 30, 2015, 11:31:48 AM11/30/15
to scalatest-users
Hi!

I face strange error. Scala 2.11.7 / Scala test 2_11/2.2.4.

I've tried to debug this under Idea and in Suite.scala

at line 1327 under debuger I see that "testName" is None, but after I do F8 (step over) code failed with exception and I go to exception handler.

That prints following:
   
Reporter completed abruptly with an exception after receiving event: TestSucceeded(Ordinal(1, 4),ScalarExamplesMultiNodeSelfTest,org.apache.ignite.scalar.tests.examples.ScalarExamplesMultiNodeSelfTest,Some(org.apache.ignite.scalar.tests.examples.ScalarExamplesMultiNodeSelfTest),testScalarPrimeExample,testScalarPrimeExample,Vector(),None,Some(IndentedText(- testScalarPrimeExample,testScalarPrimeExample,1)),Some(TopOfMethod(org.apache.ignite.scalar.tests.examples.ScalarExamplesMultiNodeSelfTest,public void org.apache.ignite.scalar.tests.examples.ScalarExamplesMultiNodeSelfTest.testScalarPrimeExample())),None,None,ScalaTest-run-running-ScalarExamplesSelfTestSuite,1448891495317).

    scala
.MatchError: None (of class scala.None$)
 at org
.scalatest.DispatchReporter.org$scalatest$DispatchReporter$$fireTestFinishedIfNecessary(DispatchReporter.scala:94)
 at org
.scalatest.DispatchReporter$Propagator.run(DispatchReporter.scala:179)
 at java
.lang.Thread.run(Thread.java:745)
   
Exception encountered when invoking run on a nested suite - None (of class scala.None$)
    scala
.MatchError: None (of class scala.None$)
 at org
.scalatest.Suite$class.runTests(Suite.scala:1327)
 at org
.scalatest.Suites.runTests(Suites.scala:52)
 at org
.scalatest.Suite$class.run(Suite.scala:1424)
 at org
.scalatest.Suites.run(Suites.scala:52)
 at org
.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:55)
 at org
.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2563)
 at org
.scalatest.tools.Runner$$anonfun$doRunRunRunDaDoRunRun$3.apply(Runner.scala:2557)
 at scala
.collection.immutable.List.foreach(List.scala:381)
 at org
.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:2557)
 at org
.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1044)
 at org
.scalatest.tools.Runner$$anonfun$runOptionallyWithPassFailReporter$2.apply(Runner.scala:1043)
 at org
.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
 at org
.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
 at org
.scalatest.tools.Runner$.run(Runner.scala:883)
 at org
.scalatest.tools.Runner.run(Runner.scala)
 at org
.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:138)
 at org
.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:28)
   
An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
    scala
.MatchError: None (of class scala.None$)
 at org
.scalatest.DispatchReporter.dispatchDisposeAndWaitUntilDone(DispatchReporter.scala:284)
 at org
.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2725)
 at org
.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
 at org
.scalatest.tools.Runner$.run(Runner.scala:883)
 at org
.scalatest.tools.Runner.run(Runner.scala)
 at org
.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:138)
 at org
.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:28)


Any ideas what is this? Scala binary incompatibility?

Bill Venners

unread,
Nov 30, 2015, 11:50:53 AM11/30/15
to scalate...@googlegroups.com
If so then we can try and reproduce it via the ignite project you pointed to. Let me know if that's it. As I mentioned in my comment there, it should be impossible to get a match error there, so it will be interesting to see what's going on.

Bill

--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Bill Venners
Artima, Inc.
http://www.artima.com

Alexey Kuznetsov

unread,
Nov 30, 2015, 2:28:31 PM11/30/15
to scalatest-users
Hi Bill, yes that was my question on SO.

I post it there and after googlig around, found this user group.

I also do not believe my eyes :)
I see in debugger variable with "None" and it started to match and failed shortly.

Any help will be appreciated. I also tried 3.0.0_SNAP13 with same result :(.

May be I should download scalatest sources and try to debug with sources?

If you wish to debug your self, you should checkout Apache Ignite, switch to ignite-1.5 branch and run ScalarExamplesSelfTestSuite.

I'm debugged under latest Oracle JDK 7.

Thanks.

P.S. This error looks very veired, I really want to go to the root of this problem.

Jacek Lewandowski

unread,
May 23, 2016, 6:14:08 AM5/23/16
to scalatest-users
I hit this problem too. It looks like there is some weird problem with classloaders. In particular the instance of "None" is not the same as passed to the method which is the source of exception. 

Stefan Wachter

unread,
Jun 9, 2016, 4:59:56 AM6/9/16
to scalatest-users
Me too.Yet in a different setting (in an Akka Streams application). Maybe this problem is not connected with ScalaTest but a more general one. How could you diagnose the classload problem?

Alexey Kuznetsov

unread,
Jun 9, 2016, 5:21:26 AM6/9/16
to scalatest-users
Hi, All

As original topic starter I have to say that after some time "scala.MatchError: None (of class scala.None$)"  is no longer reproduced on our TeamCity server.
I don't know why.

But it seems this error appear from time to time not only in my case.

Would be really great if some one will find a root cause for this error.

Stefan Wachter

unread,
Jun 9, 2016, 8:21:58 AM6/9/16
to scalatest-users
Hi Alexey,

I could solve my problem. It had to do with serialization (cf. https://groups.google.com/forum/#!msg/akka-user/jvbbilXDKdA/giruRnnSCwAJ).

--Stefan
Reply all
Reply to author
Forward
0 new messages