microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 674 forks source link

Invalid cross-thread call in CustomCommands tests #4440

Closed huguesv closed 6 years ago

huguesv commented 6 years ago

PythonToolsUITestsRunner.BuildTasksUITests.CustomCommands* are failing with this error.

Test method PythonToolsUITestsRunner.BuildTasksUITests.CustomCommandsErrorList_27 threw exception: 

TestRunnerInterop.TestFailedException: AssertFailedException: Assert.Fail failed. Invalid cross-thread call from thread 26
Assert.Fail failed. Invalid cross-thread call from thread 26

   at void TestUtilities.AssertListener.Fail(string message, string detailMessage) in E:\A\_work\27\s\Common\Tests\Utilities\AssertListener.cs:line 140

   at void System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at void TestUtilities.AssertListener.ThrowUnhandled() in E:\A\_work\27\s\Common\Tests\Utilities\AssertListener.cs:line 67

   at void TestUtilities.UI.VisualStudioApp.Dispose(bool disposing) in E:\A\_work\27\s\Common\Tests\Utilities.UI\UI\VisualStudioApp.cs:line 136

   at void TestUtilities.UI.Python.PythonVisualStudioApp.Dispose(bool disposing) in E:\A\_work\27\s\Python\Tests\Utilities.Python\PythonVisualStudioApp.cs:line 116

   at void TestUtilities.UI.VisualStudioApp.Dispose() in E:\A\_work\27\s\Common\Tests\Utilities.UI\UI\VisualStudioApp.cs:line 141

   at IVsHostedPythonToolsTestResult TestUtilities.UI.HostedPythonToolsTestRunner.InvokeTest(Type type, MethodInfo method, object[] arguments) in E:\A\_work\27\s\Common\Tests\Utilities.UI\HostedPythonToolsTestRunner.cs:line 148
huguesv commented 6 years ago
   at Microsoft.VisualStudioTools.UIThreadExtensions.MustBeCalledFromUIThread(UIThreadBase self, String message)
   at Microsoft.VisualStudioTools.UIThreadExtensions.MustBeCalledFromUIThread(IServiceProvider serviceProvider, String message)
   at Microsoft.PythonTools.Project.PythonProjectNode.set_ActiveInterpreter(IPythonInterpreterFactory value)
   at PythonToolsUITests.BuildTasksUITests.OpenProject(VisualStudioApp app, String slnName, PythonVersion python, PythonProjectNode& projectNode, Project& dteProject)
   at PythonToolsUITests.BuildTasksUITests.CustomCommandsRunInRepl(PythonVisualStudioApp app, PythonVersion python)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at TestUtilities.UI.HostedPythonToolsTestRunner.InvokeTest(Type type, MethodInfo method, Object[] arguments)
   at TestUtilities.UI.HostedPythonToolsTestRunner.Execute(String name, Object[] arguments)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)