Daily Usage Issues

Test status shows test running forever but no processing in the queue

Started by areicher on 7,357 views

Hello,

I've been having a regular problem with running tests under NCrunch since adding some XUnit tests using the LightBDD library: Test indicators in test window and in VS status bar show that the tests are running (forever) but the processing queue is empty. It's intermittent in that sometimes it doesn't happen, but most of the time it does.

I have both MSpec (these are working) and XUnit tests with LightBdd (these are not). Other runners (Resharper, VS) aren't exhibiting any obvious problems.

I have also just submitted a bug report to provide additional info.

Thanks,
Aaron
Any suggestions here? Anything I can do to provide more information than the logging (which I submitted with my initial bug report)? I love NCrunch, and I am also very happy (otherwise) with my test framework setup. However, NCrunch is not providing me the feedback I need to determine whether this is a test setup problem, a bug in NCrunch, etc...
Hi, sorry that your request slipped my net. I've taken a look at the bug report you submitted, and this appears to be a compatibility issue with LightBDD:

System.InvalidOperationException: FeatureCoordinator of LightBDD.XUnit2.Implementation.XUnit2FeatureCoordinator type is already installed
at LightBDD.Core.Execution.Coordination.FeatureCoordinator.Install(FeatureCoordinator coordinator)
at LightBDD.XUnit2.LightBddScopeAttribute.SetUp()
at LightBDD.XUnit2.Implementation.Customization.TestFrameworkExecutor.RunTestCases(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
at Xunit.Sdk.TestFrameworkExecutor`1.RunTests(IEnumerable`1 testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
at nCrunch.Module.XUnit2.Integration.XUnit2FrameworkRuntimeEnvironment.<>c__DisplayClass3_1.<RunTests>b__3()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackUnreliableActivity(String name, Action activity)
at nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackUnreliableActivity(String name, Action activity)
at nCrunch.Module.XUnit2.Integration.XUnit2FrameworkRuntimeEnvironment.<>c__DisplayClass3_0.<RunTests>b__1()
at nCrunch.TestExecution.TestExecutionMonitor.PerformMonitoredTestExecution(Action testExecutionAction)
at nCrunch.Module.XUnit2.Integration.XUnit2FrameworkRuntimeEnvironment.RunTests(TestTaskOutput output, TestExecutionMapSet testMapSet, TestExecutionParameters parameters, IIpcMessageProcessor ipcMessageProcessor)
at nCrunch.TestExecution.TestRunnerThread.()

It looks like LightBDD attempts to install itself into Xunit every time the tests are run, with no check for pre-installation. This is a big problem for a runner like NCrunch, where the test framework is often called to execute tests multiple times.

Because all of this is handled internally within LightBDD/Xunit, there is no way this problem can be fixed in NCrunch. I recommend raising it with the LightBDD devs.

To work around this, you can set your Test process memory limit to '1'. This will cause NCrunch to recycle the test process after every individual batch of tests, so that Xunit will only be told to run tests once per process instance. Note that doing this will cause serious loss in performance under NCrunch.

Post a reply

Log in to reply.