Open grofit opened 5 years ago
So looking into the failing tests in the unity editor, they seem to be related to the scheduler part of this, as Unity seems to be unable to provide or use the scheduler and blows up, not sure what needs to happen there with it but if anyone has any ideas please let us know.
This is what one of the errors looks like:
Cant_Locate_Scheduler (0.067s)
---
System.Runtime.Serialization.SerializationException : Unable to find assembly 'Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
---
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly () [0x00046] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType (System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo assemblyInfo, System.String name) [0x00078] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor (System.String objectName, System.String[] memberNames, System.Runtime.Serialization.Formatters.Binary.BinaryTypeEnum[] binaryTypeEnumA, System.Object[] typeInformationA, System.Int32[] memberAssemIds, System.Runtime.Serialization.Formatters.Binary.ObjectReader objectReader, System.Int32 objectId, System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo assemblyInfo, System.Runtime.Serialization.Formatters.Binary.SizedArray assemIdToAssemblyTable) [0x00060] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create (System.String name, System.String[] memberNames, System.Runtime.Serialization.Formatters.Binary.BinaryTypeEnum[] binaryTypeEnumA, System.Object[] typeInformationA, System.Int32[] memberAssemIds, System.Runtime.Serialization.Formatters.Binary.ObjectReader objectReader, System.Int32 objectId, System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo assemblyInfo, System.Runtime.Serialization.Formatters.Binary.SizedArray assemIdToAssemblyTable) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped (System.Runtime.Serialization.Formatters.Binary.BinaryObjectWithMapTyped record) [0x000dc] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped (System.Runtime.Serialization.Formatters.Binary.BinaryHeaderEnum binaryHeaderEnum) [0x0002e] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run () [0x000c9] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00069] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x0000c] in <ac823e2bb42b41bda67924a45a0173c3>:0
at (wrapper xdomain-dispatch) System.AppDomain.DoCallBack(object,byte[]&,byte[]&)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) System.AppDomain.DoCallBack(System.CrossAppDomainDelegate)
at (wrapper remoting-invoke-with-check) System.AppDomain.DoCallBack(System.CrossAppDomainDelegate)
at ReactiveTests.Tests.DefaultConcurrencyAbstractionLayerTest.Run (System.CrossAppDomainDelegate a) [0x00001] in C:\Code\Others\gh\unity-rx-test\RxUnityTest\Assets\Editor\Tests\Tests\DefaultConcurrencyAbstractionLayerTest.cs:31
at ReactiveTests.Tests.DefaultConcurrencyAbstractionLayerTest.Cant_Locate_Scheduler_NoPlib () [0x00019] in C:\Code\Others\gh\unity-rx-test\RxUnityTest\Assets\Editor\Tests\Tests\DefaultConcurrencyAbstractionLayerTest.cs:300
at ReactiveTests.Tests.DefaultConcurrencyAbstractionLayerTest.Cant_Locate_Scheduler () [0x00001] in C:\Code\Others\gh\unity-rx-test\RxUnityTest\Assets\Editor\Tests\Tests\DefaultConcurrencyAbstractionLayerTest.cs:290
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <ac823e2bb42b41bda67924a45a0173c3>:0
I was able to run tests in Play mode in IDE. I am trying to run on IL2CPP according documentation, but nothing happens. I have attached Android which I usually use for debugging. I was unable at all, not specifically this project. Need to check another time again.
As of error, seems may try to setup up default static task factory or scheduler, implemented on top of unity event loop. There is SynchronizationContext for unity on github, and there are schedulers which use SynchronizationContext (single thread schedulers), if to search initialization of scheduler in Rx and may be replace.
My colleague qa-devops have read and tried Unity tests. As it appears Unity tests are not run on devices, they just run in editor but build for like Android (so not IL2CPP or any other dependencies). Docs are not very clear on this....
From my brief conversation with superpig he said it was all possible and you had to use them in playmode on a different build target. I recommend nipping into unitydevs slack or their discord channel and asking as like you say the docs are not the best
Where are we on this, and how can I help ?
I had done most of the work I could do to get the project in a runnable state, it just needed someone to run them on all potential platforms and see what tests fail and then see if there is a simple avenue to fix them.
The guys in the UnityDevSlack seemed pretty open to discussing how to run the tests etc (assuming you have the hardware to run them on), and the guys in the ReactiveSlack seemed happy to discuss the potential AOT problems and see if there are any work arounds or changes that could be done, there was one guy there who says he uses rx.net in a lot of AOT scenarios via ReactiveUI(?) which he made, and he was very helpful, the only missing link is knowing what stuff is broken to be able to discuss solutions and verify them with the rx guys.
So we have peoples ears and we have a project as a baseline, we just need someone to be able to run all the tests on the actual hardware in real world scenarios to see if they pass/fail and isolate the changes needed to make it pass to see if we can get the rx.net guys to get any of the changes in.
Ok, I may be able to run those tests on Android devices, apparently the only thing we need to figure out is how to run them on devices. I'll join the UnityDevSlack then
I have my oculus quest I can test something on... If someone points me in the right direction...
Trying to get a grip on reactive programming and fell down this rabbits hole.
Should I just try building and deploying the sample scene.?
things look to be more trivial. there are rumors that nunit tests may run on devices. and there is no docs how to do it. the quest to find rigth command line parameters to run tests o e devices via unity. and than fik all failing tests.
next step is to fix tests which do not run on il2cpp but run in unity editor tests. drill into implementation of rx and find out why these fail.
Sorry late to the party again, @RDeluxe did you manage to get any info from the slack channel about how to run the tests properly? as I think once we have that everyone should be free to just run them and look at the problems.
@grofit Have you tried using a https://github.com/Cysharp/RuntimeUnitTestToolkit ?
I didnt really do much testing other than getting the original test suite up and running, I dont have many devices to run on here so left it to everyone else to test what they could. Good find though!
Did anyone get any further with this stuff? I am again wishing that I could use System.Reactive in unity with a couple of the unirx helpers.
Nope, I did not have time on my side just yet.
This is just a placeholder for conversation originally from https://github.com/neuecc/UniRx/issues/300