Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.3.0b12
2019.1.0b4
2019.3.0a6
Issue ID
1109130
Regression
No
Test Runner's results change after first Test run when using Singleton
To reproduce:
1. Open attached project ("SingletonInstancesTest")
2. In Test Runner window click "Run All"
- Tests return positive
3. Run Tests again
- Tests return negative
Expected: Results are the same after every run
Actual: Results change to negative after first run
Reproduced with: 2017.4.20f2, 2018.3.6f1, 2019.1.0b4, 2019.2.0a6
Note:
- Issue occurs only when tests are run EditMode
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on when D3D12RenderPass::SetupDeviceResources when opening FBX animation preview
- Serialization errors are thrown when "com.unity.render-pipelines.core" is added as a custom package and Graphics window is opened
- Character Joints unexpectedly rotate when a ragdoll is created using the Ragdoll Wizard
- Crash on GfxDeviceD3D11Base::DrawBuffersBatchMode when rendering the Scene view
- The shared EditorBuildSettings.asset file of symlinked projects is not updated when changing the order of the Scenes in Build Settings in one of the projects
Resolution Note:
The test is working as intended.
The singleton is being reinitialized whenever it is not present in its static variable, which will only happen after a domain reload. When running an editmode test, no domain reload will happen, unless needed. Thus the singleton from the previous run still exists.
A recommend solution could be to do a TearDown in the test, which destroys the singleton, as cleanup.