Search Issue Tracker
Won't Fix
Votes
8
Found in
2017.3.0b4
Issue ID
961454
Regression
No
InvalidOperationException Operation is not valid due to the current state of the object on enabling Playmode tests runner
To repro:
1. Create a new project.
2. Open Window - TestRunner.
3. In Playmode tab press Enable Playmode tests -> Enable -> Ok.
Error appears:
InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Pop () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Stack.cs:329)
UnityEngine.GUILayoutUtility.EndLayoutGroup () (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:323)
UnityEngine.GUILayout.EndVertical () (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:342)
UnityEditor.EditorGUILayout.EndVertical () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7858)
UnityEditor.TestTools.TestRunner.TestRunnerWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunnerWindow.cs:179)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
Expected result: No errors in log. Maybe another notification about restart can be more useful.
Comments (6)
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
EastSideGameStudio
Jan 30, 2018 22:15
I have the same error with an EndVertical() method that is hit after doing a long EditorUtility progress bar operation.
2017.2.1p2
ElSeen
Jan 18, 2018 12:50
Same error if Assets contains .dll with same names. Rename any .dll fixed this.
ISeidingerReflekt
Dec 20, 2017 14:35
found the same issue with 2017.2.0f3 ... could not find a weirdly named dll though
rasmusflashbulb
Dec 19, 2017 10:56
I also had a similar issue, but it was resolved by removing spaces in DLL names in the plugins, in my case one of the issues was "Mystery Squiggle Editor.dll" that I renamed to "MysterySquiggleEditor.dll" and then it worked.
unity_ODPxGncDQEOgmQ
Dec 11, 2017 12:55
I see this error (well actually a very similar one) due to having an editor that includes a precompiled assembly. It appears that this breaks the test runner and no tests show up any longer.
In my particular case this was after adding the Squiggle asset. However the bug would appear to reside in the test runner itself. Closing the test runner window & restarting unity clears the error.. Re-opening test runner raises the error again and there are no unit tests displayed :(
jonmjoyce
Nov 09, 2017 18:12
Seeing something similar with the TestRunner since moving to 2017.2.0f3:
InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[PrecompiledAssembly] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.SingleOrDefault[PrecompiledAssembly] (IEnumerable`1 source, System.Func`2 predicate)
UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.AssemblySelector (System.String assemblyPath) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:41)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.String].MoveNext ()
System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.String,System.String].MoveNext ()
System.Collections.Generic.List`1[System.String].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.String]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToList[String] (IEnumerable`1 source)
UnityEngine.TestTools.Utils.TestAssemblyProviderHelper.GetUserAssemblies (System.Func`2 assemblySelector, System.Func`2 selector) (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEngine.TestRunner/Utils/TestAssemblyProviderHelper.cs:45)
UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.GetUserAssemblies () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:30)
UnityEditor.TestTools.TestRunner.TestInEditorTestAssemblyProvider.GetTestsWithNUnit () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunner/Utils/TestInEditorTestAssemblyProvider.cs:23)
UnityEditor.TestTools.TestRunner.GUI.EditModeTestListGUI.GetTestListNUnit () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/Views/EditModeTestListGUI.cs:50)
UnityEditor.TestTools.TestRunner.GUI.TestListTreeViewDataSource.FetchData () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/TestListTreeView/TestListTreeViewDataSource.cs:27)
UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:53)
UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeViewController.cs:266)
UnityEditor.TestTools.TestRunner.GUI.TestListGUI.Reload () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/GUI/Views/TestListGUIBase.cs:147)
UnityEditor.TestTools.TestRunner.TestRunnerWindow.OnEnable () (at C:/buildslave/unity/build/Extensions/TestRunner/UnityEditor.TestRunner/TestRunnerWindow.cs:113)
UnityEditor.TestTools.TestRunner.TestRunnerWindow:ShowPlaymodeTestsRunnerWindowCodeBased()