Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

xunit.v3 builds eternally and can't run tests
adandy
#1 Posted : Friday, February 21, 2025 7:08:09 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2014(UTC)
Posts: 7
Location: United States of America

Thanks: 1 times
I am currently on 5.12.0.10 and am trying to use xunit.v3 1.1.0 but can't get NCrunch to build my test projects and it just spins forever. I suspect I am triggering some kind of corner case, possibly related to targeting multiple frameworks. I am able to run tests using `dotnet test` and the VS Test Explorer, so that much does work. The broken branch is public (with submodules) https://github.com/aarondandy/WeCantSpell.Hunspell/commits/test-updates/ for a reproduction.
Remco
#2 Posted : Friday, February 21, 2025 8:19:12 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,215

Thanks: 974 times
Was thanked: 1302 time(s) in 1207 post(s)
Hi,

Thanks for sharing this issue with the sample solution.

I was able to run all tests to completion on this solution without problems, so perhaps there is more to this issue than the codebase itself.

Would you mind submitting a bug report while the engine is stuck spinning? Also, could you confirm which tasks the engine is stuck on? It should be possible to examine the list of tasks in the processing queue window to see what is in progress.
adandy
#3 Posted : Friday, February 21, 2025 9:28:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2014(UTC)
Posts: 7
Location: United States of America

Thanks: 1 times
It gets stuck on Analyze Assembly. Somehow, this time, 2 of the 3 targets finished analysis. I have rebooted multiple times previously and usually all 3 targets would get stuck like this. I don't know what is different this time to cause the 2 to complete. I sent a report in while the net48 target was stuck, let me know if any other info can help. Now that some of the tests are running I am noticing that they are extremely slow, so that may be a clue as well.
Remco
#4 Posted : Friday, February 21, 2025 11:23:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,215

Thanks: 974 times
Was thanked: 1302 time(s) in 1207 post(s)
Thanks for sending through the report.

Unfortunately the report didn't contain any useful information about the problem. The hang is not being caused by errors/exceptions being thrown in the environment as far as I can tell.

When running the tests on my side, they perform very well and churning them for a period of time doesn't surface any race conditions in their execution or in the analysis steps.

I've reviewed the configuration you're running in the bug report and nothing looks abnormal.

Do you think you can attach a debugger onto one of the hung analysis tasks and see if you can get a stack trace? If you right-click the column headers in the Processing Queue Window, you can turn on the 'Process Id' column which should allow you to identify the process running under the task. Most likely there is a thread here that is hung on something.
adandy
#5 Posted : Friday, February 21, 2025 5:20:42 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2014(UTC)
Posts: 7
Location: United States of America

Thanks: 1 times
Well, it looks like I'm spending a hell of a lot of time here: https://github.com/xunit...TextReaderWriter.cs#L59

Call stack:

Code:

 	System.Private.CoreLib.dll!System.Threading.Thread.Sleep(int millisecondsTimeout)	Unknown
 	xunit.v3.runner.utility.netcore.dll!Xunit.v3.BufferedTextReaderWriter.BufferedReader.Read() Line 59	C#
 	System.Private.CoreLib.dll!System.IO.TextReader.ReadLine()	Unknown
>	xunit.v3.runner.common.dll!Xunit.Runner.Common.ConsoleHelper.ReadLine() Line 71	C#
 	xunit.v3.runner.common.dll!Xunit.Runner.Common.ConsoleRunnerLogger.WaitForAcknowledgment() Line 106	C#
 	xunit.v3.runner.inproc.console.dll!Xunit.Runner.Common.RunnerLoggerExtensions.WriteMessage(Xunit.Runner.Common.IRunnerLogger runnerLogger, Xunit.Sdk.IMessageSinkMessage message) Line 27	C#
 	xunit.v3.runner.inproc.console.dll!Xunit.Runner.InProc.SystemConsole.ConsoleRunner.ListAssembly(Xunit.Runner.Common.XunitProjectAssembly assembly, Xunit.Runner.Common.IRunnerLogger logger) Line 312	C#
 	[Resuming Async Method]	
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ConsoleRunner.<ListAssembly>d__12>.ExecutionContextCallback(object s)	Unknown
 	System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ConsoleRunner.<ListAssembly>d__12>.MoveNext(System.Threading.Thread threadPoolThread)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ConsoleRunner.<ListAssembly>d__12>.MoveNext()	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox box, bool allowInlining)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>.TrySetResult(System.Threading.Tasks.VoidTaskResult result)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetExistingTaskResult(System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult> task, System.Threading.Tasks.VoidTaskResult result)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder.SetResult()	Unknown
 	[Completed] xunit.v3.runner.inproc.console.dll!Xunit.Runner.InProc.SystemConsole.ProjectAssemblyRunner.Discover(Xunit.Runner.Common.XunitProjectAssembly assembly, Xunit.v3.ITestPipelineStartup pipelineStartup, Xunit.Sdk.IMessageSink messageSink, Xunit.Sdk.IMessageSink diagnosticMessageSink, System.Collections.Generic.IList<(Xunit.Sdk.ITestCase TestCase, bool PassedFilter)> testCases) Line 101	C#
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ProjectAssemblyRunner.<Discover>d__11>.ExecutionContextCallback(object s)	Unknown
 	System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ProjectAssemblyRunner.<Discover>d__11>.MoveNext(System.Threading.Thread threadPoolThread)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.Runner.InProc.SystemConsole.ProjectAssemblyRunner.<Discover>d__11>.MoveNext()	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox box, bool allowInlining)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult>.TrySetResult(System.Threading.Tasks.VoidTaskResult result)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.SetExistingTaskResult(System.Threading.Tasks.Task<System.Threading.Tasks.VoidTaskResult> task, System.Threading.Tasks.VoidTaskResult result)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder.SetResult()	Unknown
 	[Completed] xunit.v3.core.dll!Xunit.v3.InProcessFrontController.Find(Xunit.Sdk.IMessageSink messageSink, Xunit.Sdk.ITestFrameworkDiscoveryOptions options, System.Func<Xunit.Sdk.ITestCase, bool> filter, System.Type[] types, System.Func<Xunit.Sdk.ITestCase, bool, System.Threading.Tasks.ValueTask<bool>> discoveryCallback) Line 137	C#
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.v3.InProcessFrontController.<Find>d__11>.ExecutionContextCallback(object s)	Unknown
 	System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.v3.InProcessFrontController.<Find>d__11>.MoveNext(System.Threading.Thread threadPoolThread)	Unknown
 	System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.Threading.Tasks.VoidTaskResult>.AsyncStateMachineBox<Xunit.v3.InProcessFrontController.<Find>d__11>.MoveNext()	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox box, bool allowInlining)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task.RunContinuations(object continuationObject)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetResult(System.__Canon result)	Unknown
 	System.Private.CoreLib.dll!System.Threading.Tasks.TaskCompletionSource<object>.SetResult(object result)	Unknown
 	xunit.v3.core.dll!Xunit.v3.TestFrameworkDiscoverer<Xunit.v3.IXunitTestClass>.Find.AnonymousMethod__0(object _) Line 90	C#
 	System.Private.CoreLib.dll!System.Threading.QueueUserWorkItemCallback.Execute()	Unknown
 	System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()	Unknown
 	System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()	Unknown
 	[Async Call Stack]	
 	[Async] xunit.v3.runner.inproc.console.dll!Xunit.Runner.InProc.SystemConsole.ConsoleRunner.EntryPoint(System.IO.TextReader consoleReader, System.IO.TextWriter consoleWriter) Line 227	C#
adandy
#6 Posted : Saturday, February 22, 2025 12:47:57 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2014(UTC)
Posts: 7
Location: United States of America

Thanks: 1 times
I deleted every test from the project and it still gets stuck on Analyse. I'm starting to wonder if I have some turds stuck in a pipe somewhere. Is there a way I can flush all NCrunch state out which may be specific to my system and not on yours?
Remco
#7 Posted : Saturday, February 22, 2025 12:50:27 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,215

Thanks: 974 times
Was thanked: 1302 time(s) in 1207 post(s)
I've managed to pin this down now. I'll update you soon.
adandy
#8 Posted : Saturday, February 22, 2025 1:22:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/27/2014(UTC)
Posts: 7
Location: United States of America

Thanks: 1 times
Good to hear! Just in case it helps somehow because I was poking around already:

I nuked my .NCrunch_ folder, deleted all tests, and the net48 one seems to consistently get stuck. Also, I am seeing a weird state where the (N) logo stops churning even though it still has an item in the queue. It could indicate some kind of UI error too maybe 🤷.

Screenshot
Remco
#9 Posted : Saturday, February 22, 2025 10:03:34 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,215

Thanks: 974 times
Was thanked: 1302 time(s) in 1207 post(s)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.057 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download