Error in editmode test: GetBool is not allowed to be called while application is terminating. at <0x00000> <unknown method>

Issue #419 open
Raphael Nunes dos Santos created an issue

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)

  1. Tor Esa Vestergaard
    • changed status to open

    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.

  2. Tor Esa Vestergaard

    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?

  3. Raphael Nunes dos Santos 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?

  4. Gabriel Le Breton

    Here's a private project with the plugin installed and which runs both playmode and editmode tests in the CI: https://gitlab.com/gableroux/unity3d-gitlab-ci-odin-inspector-issue

    I 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 Unity 2018.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>
    
  5. Raphael Nunes dos Santos 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 ?

  6. Gabriel Le Breton

    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.

  7. Raphael Nunes dos Santos 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 and add-odin with the Odin plugin. The test on master are passing, but on add-odin aren't. https://gitlab.com/raphaelnsGMF/odin-test-project

    One 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: Captura de tela de 2018-09-12 11-35-44.png

    Maybe Unity is updating some script and this is broken the plugin.

  8. Raphael Nunes dos Santos 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.

  9. Tor Esa Vestergaard

    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.

  10. Gabriel Le Breton

    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 :)

  11. Raphael Nunes dos Santos 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:

    1. I created a new project with no assets
    2. 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)
    3. All the tests passed
    4. I opened the project and added some plugins to it, like: Touch Script, Localization, Build Report Toll, and other
    5. I closed the project and run the tests on terminal again
    6. All the tests passed
    7. I opened the project and add Odin to it.
    8. I closed the project and run the tests on terminal again.
    9. The tests failed
  12. Gabriel Le Breton

    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

  13. Gabriel Le Breton

    oh well indeed it also happens elsewhere as Raphael said, I’ll let you continue on this guys, good luck

  14. Log in to comment