Skip to content

CCE with enum value serialization, only with -Dpartest.exec.in.process #10909

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

Closed
lrytz opened this issue May 28, 2018 · 3 comments
Closed

CCE with enum value serialization, only with -Dpartest.exec.in.process #10909

lrytz opened this issue May 28, 2018 · 3 comments

Comments

@lrytz
Copy link
Member

lrytz commented May 28, 2018

Current 2.13.x, with a test re-enabled (was disabled in https://github.com/scala/scala/pull/6676/files#diff-e24063c0aa9e2f16a3cffeb86a736d90)

➜  scala13 git:(2.13.x) ✗ git diff | cat
diff --git a/test/files/run/enums.scala b/test/files/run/enums.scala
index b4e8e523db..164874634f 100644
--- a/test/files/run/enums.scala
+++ b/test/files/run/enums.scala
@@ -119,7 +119,7 @@ object SerializationTest {

   def run: Unit = {
     /* This is no longer possible with the proxy-based serialization for collections: */
-    //serialize(new B())
+    serialize(new B())
     serialize(new A())
   }
 }
➜  scala13 git:(2.13.x) ✗ sbt
> partest test/files/run/enums.scala --show-log
!! 1 - run/enums.scala                           [output differs]
java.lang.ClassCastException: cannot assign instance of scala.collection.generic.DefaultSerializationProxy to field SerializationTest$B.types of type scala.collection.immutable.Set in instance of SerializationTest$B
	at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2233)

> set (javaOptions in test in IntegrationTest) := (javaOptions in test in IntegrationTest).value.filterNot(_.contains("exec.in.process"))

> partest test/files/run/enums.scala
ok 1 - run/enums.scala

Compiling and running the test on the command line also succeeds. We should figure out what's going on here.

@szeiger
Copy link

szeiger commented Jun 7, 2018

It's probably an instance of #9237. Running with partest.exec.in.process puts the test classes into a different ClassLoader than the standard library so you get circular dependencies between the classloaders on deserialization. When you run it standalone everything is in the same classloader.

@lrytz
Copy link
Member Author

lrytz commented Jun 8, 2018

Ah, that makes sense, thanks.

@szeiger szeiger modified the milestones: 2.13.0-M5, 2.13.0-RC1 Aug 8, 2018
@szeiger
Copy link

szeiger commented Jan 8, 2019

Closing as duplicate of #9237

@szeiger szeiger closed this as completed Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants