Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrency problem in PlatformServiceProvider.GetTestContext #3953

Open
stan-sz opened this issue Oct 18, 2024 · 0 comments
Open

Concurrency problem in PlatformServiceProvider.GetTestContext #3953

stan-sz opened this issue Oct 18, 2024 · 0 comments

Comments

@stan-sz
Copy link

stan-sz commented Oct 18, 2024

Describe the bug

Concurrency problem in Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.PlatformServiceProvider.GetTestContext

Steps To Reproduce

MSTest 3.6.1 + MSTest.SDK (using MSTest Runner)

Expected behavior

No exception

Actual behavior

System.AggregateException: One or more errors occurred. (Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray'))
---> System.ArgumentException: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')
   at System.Array.CopyImpl(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
   at System.Collections.Generic.List`1.set_Capacity(Int32 value)
   at System.Collections.Generic.List`1.AddWithResize(T item)
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestRunCancellationToken.Register(Action callback) in /_/src/Adapter/MSTest.TestAdapter/Execution/TestRunCancellationToken.cs:line 61
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.PlatformServiceProvider.GetTestContext(ITestMethod testMethod, StringWriter writer, IDictionary`2 properties) in /_/src/Adapter/MSTest.TestAdapter/PlatformServiceProvider.cs:line 161
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner.RunSingleTest(TestMethod testMethod, IDictionary`2 testContextProperties) in /_/src/Adapter/MSTest.TestAdapter/Execution/UnitTestRunner.cs:line 141
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsWithTestRunner(IEnumerable`1 tests, ITestExecutionRecorder testExecutionRecorder, String source, IDictionary`2 sourceLevelParameters, UnitTestRunner testRunner) in /_/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs:line 438
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.<>c__DisplayClass21_1.<ExecuteTestsInSource>b__7() in /_/src/Adapter/MSTest.TestAdapter/Execution/TestExecutionManager.cs:line 363
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants