dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.06k stars 4.04k forks source link

Integration test failure due to concurrent collection modification in light bulb #57330

Open sharwell opened 3 years ago

sharwell commented 3 years ago

https://dev.azure.com/dnceng/public/_build/results?buildId=1427735

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

Server stack trace: 
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulb.AddMenuItemsForNewActions(IEnumerable`1 actionSets)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulb.SyncContextMenuWithSessionCore(IEnumerable`1 actionSets, QuerySuggestedActionCompletionStatus status)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulb.SyncContextMenuWithSession(IEnumerable`1 actionSets, QuerySuggestedActionCompletionStatus status)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout)
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.InProcComponent.WaitForApplicationIdle(TimeSpan timeout) in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/InProcComponent.cs:line 106
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.Editor_InProc.TryGetActiveTextViewHost() in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs:line 88
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.Editor_InProc.GetActiveTextViewHost() in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs:line 77
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.Editor_InProc.GetActiveTextView() in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/Editor_InProc.cs:line 59
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.TextViewWindow_InProc.<<WaitForLightBulbSession>b__3_0>d.MoveNext() in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/TextViewWindow_InProc.cs:line 88
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess.TextViewWindow_InProc.WaitForLightBulbSession() in /_/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/TextViewWindow_InProc.cs:line 92
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

18 49 06-BasicGenerateTypeDialog SameProject-InvalidOperationException

Build Kind Start Time
1427735 Rolling 2021-18-10
CyrusNajmabadi commented 3 years ago

@AmadeusW

CyrusNajmabadi commented 3 years ago

likely dupe of https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1417334. However, we are trailing in CI. @vatsalyaagrawal ?