- changed status to open
Error in editmode test: GetBool is not allowed to be called while application is terminating. at <0x00000> <unknown method>
1 - Waht happened?
I'm trying to run test in terminal on editomode
: ./Unity -projectPath /home/my-project -runTests -testPlatform editmode -testResults /home/my-project-results.xml -logFile -batchmode
. I created a new project with no assets and all the tests passed, but after add the Odin plugin the tests failed with the error:
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
GetBool is not allowed to be called while application is terminating.
(Filename: /home/builduser/buildslave/unity/build/Runtime/Scripting/ScriptingThreadAndSerializationSafeCheck.cpp Line: 85)
Unhandled Exception: UnityEngine.UnityException: GetBool is not allowed to be called while application is terminating.
at <0x00000> <unknown method>
at <0x00000> <unknown method>
at <0x00000> <unknown method>
at <0x00000> <unknown method>
at <0x00000> <unknown method>
at <0x00000> <unknown method>
ERROR: Job failed: exit code 1
2 - How can we reproduce it?
Create a new project on Linux using the Unity3D version 2018.2.6f1 and add the Odin to it. After that run the command at terminal: ./Unity -projectPath /home/my-project -runTests -testPlatform editmode -testResults /home/my-project-results.xml -logFile -batchmode
4 - Waht version of Unity are you using? Unity3D 2018.2.6f1
5 - What version of Odin are you using? 2.0.3
6 - Do you have Editor Only mode enabled? No.
7 - What operating system are you on? Ubuntu 18.04.1 LTS
Comments (20)
-
-
reporter -
reporter @TorVestergaard Thanks for the help. I added the
log
andtest.xml
files. -
Hmm, that's quite mysterious. It looks like everything runs and works great, and then while the application is shutting down, it gets that error out of nowhere, which is curious. Does this happen if you just open an Odin project in the normal Linux editor, and then close it again manually and have a look at the logs?
-
reporter I opened and closed the Editor, but de log file showed no error, so i opened and closed the Editor in batchMode using command line (
./Unity -projectPath /home/Documentos/test -batchmode -quit
), but the log file was still showing no error.Are there any options in the plugin related with the serialization that i can change and test?
-
You can try to enable editor only mode, and see if that makes any difference?
-
Here's a private project with the plugin installed and which runs both
playmode
andeditmode
tests in the CI: https://gitlab.com/gableroux/unity3d-gitlab-ci-odin-inspector-issueI invited these to the project:
Raphael Nunes @raphaelnsGMF
Tor Vestergaard @ilmarinen
I wasn't able to reproduce this using
Odin_Inspector_2.0.3.unitypackage
and Unity2018.2.6f1
. It succeeded: https://gitlab.com/gableroux/unity3d-gitlab-ci-odin-inspector-issue/-/jobs/96811022<?xml version="1.0" encoding="utf-8"?> <test-run id="2" testcasecount="2" result="Passed" total="2" passed="2" failed="0" inconclusive="0" skipped="0" asserts="0" engine-version="3.5.0.0" clr-version="" start-time="2018-09-11 23:38:37Z" end-time="2018-09-11 23:38:38Z" duration="0.8058362"> <test-suite type="TestSuite" id="1000" name="ThirdPersonControlOrbitCam" fullname="ThirdPersonControlOrbitCam" runstate="Runnable" testcasecount="2" result="Passed" start-time="2018-09-11 23:38:37Z" end-time="2018-09-11 23:38:38Z" duration="0.805836" total="2" passed="2" failed="0" inconclusive="0" skipped="0" asserts="0"> <test-suite type="Assembly" id="1004" name="Assembly-CSharp-Editor.dll" fullname="/builds/gableroux/unity3d-gitlab-ci-odin-inspector-issue/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll" runstate="Runnable" testcasecount="2" result="Passed" start-time="2018-09-11 23:38:38Z" end-time="2018-09-11 23:38:38Z" duration="0.210940" total="2" passed="2" failed="0" inconclusive="0" skipped="0" asserts="0"> <properties> <property name="_PID" value="29" /> <property name="_APPDOMAIN" value="Unity Child Domain" /> </properties> <test-suite type="TestFixture" id="1001" name="EditModeExampleTests" fullname="EditModeExampleTests" classname="EditModeExampleTests" runstate="Runnable" testcasecount="2" result="Passed" start-time="2018-09-11 23:38:38Z" end-time="2018-09-11 23:38:38Z" duration="0.050995" total="2" passed="2" failed="0" inconclusive="0" skipped="0" asserts="0"> <test-case id="1002" name="EditModeExampleTestSimplePasses" fullname="EditModeExampleTests.EditModeExampleTestSimplePasses" methodname="EditModeExampleTestSimplePasses" classname="EditModeExampleTests" runstate="Runnable" seed="1637617883" result="Passed" start-time="2018-09-11 23:38:38Z" end-time="2018-09-11 23:38:38Z" duration="0.017559" asserts="0" /> <test-case id="1003" name="EditModeExampleTestWithEnumeratorPasses" fullname="EditModeExampleTests.EditModeExampleTestWithEnumeratorPasses" methodname="EditModeExampleTestWithEnumeratorPasses" classname="EditModeExampleTests" runstate="Runnable" seed="1242389915" result="Passed" start-time="2018-09-11 23:38:38Z" end-time="2018-09-11 23:38:38Z" duration="0.013293" asserts="0"> <properties> <property name="_JOINTYPE" value="UnityCombinatorial" /> </properties> </test-case> </test-suite> </test-suite> </test-suite> </test-run>
-
reporter This is very strange because i only created a new project on Ubuntu using Unity3d2018.2.6f1 and added the Odin 2.0.3 to it. I havent change any configuration or added other features. You change something in the project @gableroux ?
-
Absolutely nothing special. The example project back in the days, all I did was to create a unity project, add 3rd Person Controller + Fly Mode , added buildscript and ci files, upgraded to 2018.2.6f1 after some time. The new project I made is just the same project with only odin plugin installed with the same other tests. Are your tests using the plugin? Maybe you took an older version of the project's tests or files? I started from bd285d84 commit on my side.
-
reporter So your project already have some scripts and was created with an old version of Unity. To show the error i created a public project with two branches: the
master
with only the Unity3D2018.2.6f1 new blank project andadd-odin
with the Odin plugin. The test onmaster
are passing, but onadd-odin
aren't. https://gitlab.com/raphaelnsGMF/odin-test-projectOne thing i noticed is that when you add the plugin to Unity a warning shows up asking permission to update the scrips that contains old apis:
Maybe Unity is updating some script and this is broken the plugin.
-
You should actually always say yes to the API updater when installing Odin.
-
reporter After losing a while trying to figure out what the diffent of @gableroux's project and my i finaly was able to make the tests passed. I dont know why but when the project has no editor mode tests and Odin installed the tests in batchmode fail, but if i add only one editor test in the project the tests pass. The test pipeline: https://gitlab.com/raphaelnsGMF/odin-test-project/-/jobs/97137908
-
reporter For me the issue is closed, but i think that will be a good idea added to Odin's documentation that the editor tests will not pass if you try to run it using command line.
Thanks, @TorVestergaard @gableroux for the help.
-
To clarify your request for an Odin documentation note, is this not apparently only related to this particular testing pipeline technology (as far as I understand it)? Odin contains no tests which are distributed in the package itself, all of our tests are run before the package is made, so I'm not sure what you mean, there.
-
For the record, the testing pipeline techno in question is only Unity on linux running inside a docker container and executed by commandline and wrapped in xvfb (x-server virtual frame buffer)
Unity’s default behaviour when there are no tests is to pass, but when Odin is installed, if there are no tests, running the editmode tests fail with the GetBool error.
The private project I made on gitlab only demonstrates that it passes when Odin is installed and that there is at least one test in editmode. I did not verify anything else, but Raphael mentioned earlier that the only difference between my project and his project was the lack of editmode tests (which usually passes, but when Odin is installed, it fails).
Hope it’s clear now. I would personally write this in the documentation:
Known issue: when there are no editmode tests and the Odin plugin is installed, editmode tests will fail with GetBool error. You can simply add a single passing test and it will be fine. link to issue for more details.
Or you could also find what causes this and fix it, but it may not be worth it that much. You can at least lower the priority as the workaround is quite simple. Good luck guys :)
-
So we are talking about the Unity Test Runner here? https://docs.unity3d.com/Manual/testing-editortestsrunner.html
-
reporter No @TorVestergaard because this error occours localy too on Linux and Windows too (i didn't test on Mac). To make shure that this is error caused by Odin Inspector i did a new test:
- I created a new project with no assets
- I closed the Unity and run the tests on terminal (./Unity -projectPath /home/Documentos/test -runTests -testPlatform editmode -testResults /home/Documentos/test.xml -logFile -batchmode)
- All the tests passed
- I opened the project and added some plugins to it, like: Touch Script, Localization, Build Report Toll, and other
- I closed the project and run the tests on terminal again
- All the tests passed
- I opened the project and add Odin to it.
- I closed the project and run the tests on terminal again.
- The tests failed
-
Yes and more precisely, when invoked from the command line: https://docs.unity3d.com/Manual/CommandLineArguments.html
Just as shown in the CI example I provided: /opt/Unity/Editor/Unity -projectPath /builds/gableroux/unity3d-gitlab-ci-odin-inspector-issue -runTests -testPlatform editmode -testResults /builds/gableroux/unity3d-gitlab-ci-odin-inspector-issue/editmode-results.xml -logFile -batchmode
-
oh well indeed it also happens elsewhere as Raphael said, I’ll let you continue on this guys, good luck
-
reporter NO @TorVestergaard we are talking abount running the tests on terminal: https://docs.unity3d.com/Manual/PlaymodeTestFramework.html
The last topic on this page explaion this in more details.
- Log in to comment
Would it be possible in any way for us to get some stacktraces, or anything else that might point to what's going on? Odin is nowhere in that stacktrace - perhaps having the full Editor.log file will help? We don't have a Linux environment set up and it will take us some preparation time to try to start debugging this.