Rank: Advanced Member
Groups: Registered
Joined: 1/17/2014(UTC) Posts: 31
Thanks: 17 times Was thanked: 5 time(s) in 5 post(s)
|
Hi, We're occasionally seeing the below error failing a build on our CI server running NUnit tests via the console runner. I'm not aware of anybody seeing it running the tests using NCrunch locally. It seems like every test in one file failed, but everything else was fine. I'm not sure if this is an NCrunch or NUnit issue (or even an issue with our code) but I thought I'd run it by you first. NUnit version is 3.8.1 and Console Tool is v3.19.0.2. (We've seen this in the past with older versions of the Console tool too.) Let me know if you want any additional info and I'm happy to provide it. Code:
[09:09:24]F: [Step 2/3] BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests.AddOrUpdate_InstanceACanReadValuesWrittenByInstanceB
[09:09:24] : [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests.AddOrUpdate_InstanceACanReadValuesWrittenByInstanceB] [Test Output]
NCrunch: This test was executed on server '(local)'
An exception was thrown in the Task Environment: System.InvalidOperationException: The context has already been initialized
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
System.InvalidOperationException: The context has already been initialized
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
[09:09:24]F: [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests.AddOrUpdate_InstanceACanReadValuesWrittenByInstanceB] System.InvalidOperationException: The context has already been initialized
[09:09:24]F: [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests.AddOrUpdate_InstanceACanReadValuesWrittenByInstanceB] System.InvalidOperationException: The context has already been initialized
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
[09:08:40]E: [Step 2/3] Failed tests detected
[09:09:24]F: [Step 2/3] BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests._Fixture_
[09:09:24] : [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests._Fixture_] [Test Output]
NCrunch: This test was executed on server '(local)'
An exception was thrown in the Task Environment: System.InvalidOperationException: Invalid attempt made to decrement the event's count below zero.
at System.Threading.CountdownEvent.Signal()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.OnChildItemCompleted(Object sender, EventArgs e)
at NUnit.Framework.Internal.Execution.WorkItem.WorkItemComplete()
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work, ParallelExecutionStrategy strategy)
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
System.InvalidOperationException: Invalid attempt made to decrement the event's count below zero.
at System.Threading.CountdownEvent.Signal()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.OnChildItemCompleted(Object sender, EventArgs e)
at NUnit.Framework.Internal.Execution.WorkItem.WorkItemComplete()
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work, ParallelExecutionStrategy strategy)
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
An exception was thrown in the Task Environment: System.Threading.ThreadStateException: Thread is not running; it cannot be suspended.
at System.Threading.Thread.SuspendInternal()
at System.Threading.Thread.Suspend()
at nCrunch.TestExecution.StackTraceExtractor. (Thread )
at nCrunch.TestExecution.StackTraceExtractor.TryExtractStackTraceFromRunningThread(Thread thread)
at nCrunch.TestExecution.TimeoutEnforcement.AbortingTimeoutEnforcer.PerformEnforcement(ExecutingTest test)
at nCrunch.TestExecution.TimeoutEnforcement.BaseTimeoutEnforcer. (Object )
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
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.TimerQueueTimer.CallCallback()
[09:09:24] : [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests._Fixture_] [Test Output]
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback()
System.Threading.ThreadStateException: Thread is not running; it cannot be suspended.
at System.Threading.Thread.SuspendInternal()
at System.Threading.Thread.Suspend()
at nCrunch.TestExecution.StackTraceExtractor. (Thread )
at nCrunch.TestExecution.StackTraceExtractor.TryExtractStackTraceFromRunningThread(Thread thread)
at nCrunch.TestExecution.TimeoutEnforcement.AbortingTimeoutEnforcer.PerformEnforcement(ExecutingTest test)
at nCrunch.TestExecution.TimeoutEnforcement.BaseTimeoutEnforcer. (Object )
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
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.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback()
Timeout of 60000 expired
[09:09:24]F: [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests._Fixture_] System.InvalidOperationException: Invalid attempt made to decrement the event's count below zero.
[09:09:24]F: [BusinessObjects.Repositories.Tests : [redacted].BusinessObjects.Repositories.Tests.PersistentDictionaryTests._Fixture_] System.InvalidOperationException: Invalid attempt made to decrement the event's count below zero.
at System.Threading.CountdownEvent.Signal()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.OnChildItemCompleted(Object sender, EventArgs e)
at NUnit.Framework.Internal.Execution.WorkItem.WorkItemComplete()
at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work, ParallelExecutionStrategy strategy)
at NUnit.Framework.Internal.Execution.ParallelWorkItemDispatcher.Dispatch(WorkItem work)
at NUnit.Framework.Internal.Execution.CompositeWorkItem.RunChildren()
at NUnit.Framework.Internal.Execution.CompositeWorkItem.PerformWork()
at NUnit.Framework.Internal.Execution.WorkItem.RunOnCurrentThread()
at NUnit.Framework.Internal.Execution.WorkItem.Execute()
at NUnit.Framework.Internal.Execution.TestWorker.TestWorkerThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
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 System.Threading.ThreadHelper.ThreadStart()
|