You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error TESTERROR: GetDownload (53ms): Error Message: Error calling Test Cleanup method for test class Aiursoft.Tracer.Tests.IntegrationTests.BasicTests: System.MethodAccessException: Attempt by method
#5072
Closed
Anduin2017 opened this issue
Feb 19, 2025
· 2 comments
Exit code is 0
Last runner error: Process /usr/lib/dotnet/dotnet:192904 exited with code '0'.
--- EXCEPTION #1/1 [LoggerException]
Message = “Process /usr/lib/dotnet/dotnet:192904 exited with code '0'.”
StackTraceString = “
at JetBrains.Util.ILoggerEx.LogMessage(ILogger logger, LoggingLevel level, String message) in LogMessage.il:line IL_002E mvid 48B4
at JetBrains.Util.ILoggerEx.Error(ILogger logger, String message) in Error.il:line IL_0000 mvid 48B4
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerRunStrategy.AnalyseProcessCrash(ProcessExitedUnexpectedlyException ex, IUnitTestRun run) in AnalyseProcessCrash.il:line IL_006B mvid 1598
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerRunStrategy.Run(IUnitTestRun run) in Run.il:line IL_01C8 mvid 1598
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid C608
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext() in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid C608
at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetException(Exception exception, Task1& taskField) in SetException.il:line IL_0025 mvid C608
at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerAgentManager.TestRunnerExecutionAgent.RunTests(CancellationToken cancelCt, CancellationToken abortCt) in RunTests.il:line IL_00AE mvid 1598
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid C608
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext() in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid C608
at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetException(Exception exception, Task1& taskField) in SetException.il:line IL_0025 mvid C608
at JetBrains.ReSharper.UnitTestFramework.Common.Extensions.TaskExtensions.CancelIf(Task task, CancellationToken ct, TaskCreationOptions options) in CancelIf.il:line IL_0126 mvid 1598
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid C608
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext() in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at System.Threading.Tasks.Task1.TrySetResult(TResult result) in TrySetResult.il:line IL_004B mvid C608
at System.Threading.Tasks.Task.TwoTaskWhenAnyPromise1.Invoke(Task completingTask) in Invoke.il:line IL_0088 mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute) in FinishSlow.il:line IL_0003 mvid C608
at System.Threading.Tasks.Task.TrySetException(Object exceptionObject) in TrySetException.il:line IL_0022 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.SetException(Exception exception, Task1& taskField) in SetException.il:line IL_0025 mvid C608
at JetBrains.ReSharper.UnitTestFramework.Common.Extensions.TaskExtensions.ThrowIf[TException](Task task, Task signallingTask, Func1 exceptionFactory) in ThrowIf.il:line IL_00A9 mvid 1598
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid C608
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in RunInternal.il:line IL_0040 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext() in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in RunOrScheduleAction.il:line IL_003B mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at System.Threading.Tasks.Task1.TrySetResult(TResult result) in TrySetResult.il:line IL_004B mvid C608
at System.Threading.Tasks.Task.TwoTaskWhenAnyPromise1.Invoke(Task completingTask) in Invoke.il:line IL_0088 mvid C608
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in RunContinuations.il:line IL_0065 mvid C608 or RunContinuations.il:line IL_0090 mvid C608
at JetBrains.Util.ProcessExtensions.WaitForExitAsync(IPreparedProcess process, CancellationToken token) in WaitForExitAsync.il:line IL_018C mvid 3FCB
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecutionContextCallback(Object s) in ExecutionContextCallback.il:line IL_0000 mvid C608
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in RunFromThreadPoolDispatchLoop.il:line IL_0015 mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.MoveNext(Thread threadPoolThread) in MoveNext.il:line IL_0000 mvid C608 or MoveNext.il:line IL_0040 mvid C608 or MoveNext.il:line IL_004E mvid C608
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder1.AsyncStateMachineBox1.ExecuteFromThreadPool(Thread threadPoolThread) in ExecuteFromThreadPool.il:line IL_0000 mvid C608
at System.Threading.ThreadPoolWorkQueue.Dispatch() in Dispatch.il:line IL_013F mvid C608
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in WorkerThreadStart.il:line IL_00A0 mvid C608
”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
I also tried calling from dotnet test:
/usr/lib/dotnet/sdk/9.0.102/Microsoft.TestPlatform.targets(48,5): error TESTERROR:
GetDownload (53ms): Error Message: Error calling Test Cleanup method fortest class Aiursoft.Tracer.Tests.IntegrationTests.BasicTests: System.MethodAccessException: Attempt by method 'Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.RunTestCleanupMethod(Microsoft.VisualS tudio.TestTools.UnitTesting.TestResult, System.Threading.CancellationTokenSource)' to access method 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.set_CancellationTokenSource(System.Threading.CancellationTokenSource)' failed.
However, 3.7.3 doesn't have this issue.
My test code:
usingAiursoft.CSTools.Tools;usingAngleSharp.Html.Dom;usingMicrosoft.VisualStudio.TestTools.UnitTesting;usingAiursoft.Tracer.Tests.Tools;usingMicrosoft.Extensions.Hosting;usingstaticAiursoft.WebTools.Extends;usingAiursoft.AiurObserver.DefaultConsumers;usingAiursoft.AiurObserver.WebSocket;namespaceAiursoft.Tracer.Tests.IntegrationTests;[TestClass]publicclassBasicTests{privatereadonlystring_endpointUrl;privatereadonlyint_port;privatereadonlyHttpClient_http;privateIHost?_server;publicBasicTests(){_port=Network.GetAvailablePort();_endpointUrl=$"http://localhost:{_port}";_http=newHttpClient();}[TestInitialize]publicasyncTaskCreateServer(){_server=awaitAppAsync<Startup>([],port:_port);await_server.StartAsync();}[TestCleanup]publicasyncTaskCleanServer(){if(_server==null)return;await_server.StopAsync();_server.Dispose();}[TestMethod]publicasyncTaskGetHome(){varresponse=await_http.GetAsync(_endpointUrl);vardoc=awaitHtmlHelpers.GetDocumentAsync(response);response.EnsureSuccessStatusCode();// Status Code 200-299Assert.AreEqual("text/html; charset=utf-8",response.Content.Headers.ContentType?.ToString());varp=doc.QuerySelector("p.lead")asIHtmlElement;Assert.AreEqual("Aiursoft Tracer is a simple network quality testing app. Helps testing the connection speed between you and the server.",p?.InnerHtml);}[TestMethod]publicasyncTaskGetDownload(){varurl=_endpointUrl+"/download.dat";varresponse=await_http.GetAsync(url,HttpCompletionOption.ResponseHeadersRead);response.EnsureSuccessStatusCode();// Status Code 200-299}[TestMethod]publicasyncTaskPing(){varurl=_endpointUrl+"/pINg";varresponse=await_http.GetAsync(url);varcontent=awaitresponse.Content.ReadAsStringAsync();response.EnsureSuccessStatusCode();// Status Code 200-299Assert.AreEqual("application/json; charset=utf-8",response.Content.Headers.ContentType?.ToString());Assert.AreEqual("[]",content);}[TestMethod]publicasyncTaskTestConnect(){varendPoint=_endpointUrl.Replace("http","ws")+"/Home/Pushing";varsocket=awaitendPoint.ConnectAsWebSocketServer();awaitTask.Factory.StartNew(()=>socket.Listen());varcounter=newMessageCounter<string>();socket.Subscribe(counter);varlastStage=newMessageStageLast<string>();socket.Subscribe(lastStage);awaitTask.Delay(5000);awaitsocket.Close();awaitTask.Delay(10);varlatestTime=lastStage.Stage?.Split('|')[0];Assert.IsTrue(DateTime.TryParse(latestTime,out_),$"Got message {latestTime} is not a date time.");Assert.IsTrue(counter.Count>30);Assert.IsTrue(counter.Count<70);}}
Thanks for reporting this. Just to be sure, did you update both MSTest.TestAdapter and MSTest.TestFramework? If you only update TestAdapter, then it's expected to not work.
I investigated this issue, and it seems that in your repo there is a net9.0 directory besides the csproj which is containing 3.7.3 binaries and it is causing issues. If you delete this directory, it should work correctly.
After upgrading:
I also tried calling from
dotnet test
:However, 3.7.3 doesn't have this issue.
My test code:
My csproj:
Project clone endpoint: https://gitlab.aiursoft.cn/aiursoft/tracer.git
The text was updated successfully, but these errors were encountered: