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

Notification

Icon
Error

Thread Aborted and Timeout of 60000 Expired Exceptions
CoolBreeze
#1 Posted : Tuesday, March 10, 2015 9:22:09 PM(UTC)
Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
I'm encountering the "Thread was being aborted" and "Timeout of 60000 expired" exceptions.

I'm using Selenium, MBUnit and NCrunch (2.13) and Visual Studio 2010.

My test builds all the test cases and then performs the actual tests. The test build function calls New CrytoStream() to decipher several pieces of text for the test values to be inserted into a web form.

If I run the test not in debug mode I get the exceptions. If I run the test in debug-mode and step through some of the test case building code then the exceptions don't occur.

Last year, I ran these tests using Gallio and the best I can remember Gallio didn't report the two exceptions.

I applied the MBUnit <Timeout(0)> attribute to the test function.

I'd love to get the test to run without having to put it in debug-mode and step through of the test case building code.

Here's the NCrunch test output window contents.


*** Failures ***

An exception occurred while preparing to run test 'WebUITests/TEST_XY_WebUI_NewApplication/CreateApp'.
System.Threading.ThreadAbortException: Thread was being aborted.
HResult: -2146233040


Timeout of 60000 expired

Stack trace at point of timeout:

at System.Security.Cryptography.Utils._AcquireCSP(CspParameters param, SafeProvHandle& hProv)
at System.Security.Cryptography.Utils.AcquireProvHandle(CspParameters parameters)
at System.Security.Cryptography.CryptoAPITransform..ctor(Int32 algid, Int32 cArgs, Int32[] rgArgIds, Object[] rgArgValues, Byte[] rgbKey, PaddingMode padding, CipherMode cipherChainingMode, Int32 blockSize, Int32 feedbackSize, Boolean useSalt, CryptoAPITransformMode encDecMode)
at System.Security.Cryptography.DESCryptoServiceProvider._NewEncryptor(Byte[] rgbKey, CipherMode mode, Byte[] rgbIV, Int32 feedbackSize, CryptoAPITransformMode encryptMode)
at System.Security.Cryptography.DESCryptoServiceProvider.CreateDecryptor(Byte[] rgbKey, Byte[] rgbIV)
at Planet.XY_LIB_Endec.Decrypt(String strKey, String strData) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\Library\XY_LIB_Endec.vb:line 134
at Planet.XY_LIB_Endec.GetStringFromEncryptedBase64(String strKey, String strData) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\Library\XY_LIB_Endec.vb:line 165
at Planet.XY_LIB_Cipher.DecipherBase64(String Data) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\Library\XY_LIB_Cipher.vb:line 11
at Planet.XY_BLL_Applications.Decipher(DataRow Dr) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\BusinessLogicLayer\XY_BLL_Applications.vb:line 85
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at Planet.XY_BLL_Applications.Decipher(DataTable Dt) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\BusinessLogicLayer\XY_BLL_Applications.vb:line 95
at Planet.XY_BLL_Applications.ReadBySearchCriteriaViaServer(Int32 UserId, SearchFields SearchField, SearchOperators SearchOperator, String SearchTerm) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\BusinessLogicLayer\XY_BLL_Applications.vb:line 580
at Planet.XY_BLL_Applications.ReadBySearchCriteria(Int32 UserId, SearchFields SearchField, SearchOperators SearchOperator, String SearchTerm) in XC:\Development\Planet\Dev\WS\WEB\Planet\Planet\BusinessLogicLayer\XY_BLL_Applications.vb:line 555
at WebUITests.TEST_XY_WebUI_Name.IdGet(Int32 UserId) in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_Name.vb:line 63
at WebUITests.TEST_XY_WebUI_Name.CreateTestName(Int32 UserId) in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_Name.vb:line 45
at WebUITests.TEST_XY_WebUI_NewApplication_ForeignAddress.Phase2() in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_NewApplication_ForeignAddress.vb:line 75
at WebUITests.TEST_XY_WebUI_NewApplication_Basic..ctor(Int32 UserId, String FacilityName) in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_NewApplication_Basic.vb:line 65
at WebUITests.TEST_XY_WebUI_NewApplication_ForeignAddress..ctor(Int32 UserId, String FacilityName) in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_NewApplication_ForeignAddress.vb:line 7
at WebUITests.TEST_XY_WebUI_NewApplication.CreateAppFactory_ServiceFacilityAddressOptions(List`1 Tests) in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_NewApplication.vb:line 153
at WebUITests.TEST_XY_WebUI_NewApplication.CreateAppFactory() in XC:\Development\Planet\Dev\Tests\WebUITests\WebUITests\TEST_XY_WebUI_NewApplication.vb:line 136
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Gallio.Framework.Pattern.FixtureMemberInvoker`1.<>c__DisplayClass3.<TryGetMemberAsMethod>b__0(Object[] args)
at Gallio.Framework.Pattern.FixtureMemberInvoker`1.InvokeImpl(FixtureMemberInvokerTargets targets, Object[] args)
at MbUnit.Framework.FactoryAttribute.<>c__DisplayClass1.<PopulateDataSource>b__0()
at Gallio.Framework.Data.FactoryDataSet.<GetItemsImpl>d__0.MoveNext()
at Gallio.Framework.Data.ConcatenationMergeStrategy.<Merge>d__0.MoveNext()
at Gallio.Framework.Data.CombinatorialJoinStrategy.<Join>d__0.MoveNext()
at Gallio.Framework.Data.JoinedDataSet.<GetItemsImpl>d__0.MoveNext()
at Gallio.Framework.Data.DataBindingContext.<GetItems>d__0.MoveNext()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestInstanceAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestDataItemAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestInstanceAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestDataItemAction.Run()
at Gallio.Framework.Pattern.PatternTestExecutor.RunTestAction.Run()
at Gallio.Framework.Pattern.PatternTestController.RunImpl(ITestCommand rootTestCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
at Gallio.Model.Helpers.DelegatingTestController.RunTest(ITestCommand testCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
at Gallio.Model.Helpers.DelegatingTestController.RunTest(ITestCommand testCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
at Gallio.Model.Helpers.DelegatingTestController.RunImpl(ITestCommand rootTestCommand, TestStep parentTestStep, TestExecutionOptions options, IProgressMonitor progressMonitor)
at Gallio.Model.Helpers.SimpleTestDriver.RunTestCommandsAction.Run()
at Gallio.Model.Helpers.SimpleTestDriver.RunAssembly(Assembly assembly, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
at Gallio.Model.DotNetTestDriver.ExploreOrRunTask.ExploreOrRun(Type driverType, Object[] driverArguments, String assemblyPath, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor, Boolean useSynchronousMessaging)
at Gallio.Model.DotNetTestDriver.ExploreOrRunTask.RunImpl(Object[] args)
at Gallio.Model.Isolation.IsolatedTask.Run(Object[] args)
at nCrunch.GallioIntegration.NCrunchTestIsolationContext.InvokeTask[TIsolatedTask](IHost host, TIsolatedTask isolatedTask, Object[] args)
at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskInHost[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args)
at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskImpl[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args)
at Gallio.Model.Isolation.BaseTestIsolationContext.RunIsolatedTask[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args)
at Gallio.Model.DotNetTestDriver.ExploreOrRunAssembly(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, RemoteMessageSink remoteMessageSink, IProgressMonitor progressMonitor, String taskName, FileInfo file)
at Gallio.Model.DotNetTestDriver.ExploreOrRun(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor, String taskName)
at Gallio.Model.DotNetTestDriver.RunImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
at Gallio.Model.BaseTestDriver.Run(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.<>c__DisplayClass1f.<RunImpl>b__1d(ITestDriver driver, IList`1 items, Int32 driverCount)
at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func)
at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.RunImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
at Gallio.Model.BaseTestDriver.Run(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
at Gallio.Runner.DefaultTestRunner.Run(TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IProgressMonitor progressMonitor)
at nCrunch.Module.Gallio.Integration.GallioWrapper.<>c__DisplayClassa.<RunTests>b__8()
at nCrunch.TestExecution.TestExecutionMonitor.PerformMonitoredTestExecution(Action testExecutionAction)
at nCrunch.Module.Gallio.Integration.GallioWrapper.RunTests(TestTaskOutput output, IList`1 testsToRun, TestExecutionMapSet testMapSet, Boolean considerInconclusiveTestsAsPassing)
at nCrunch.Module.Gallio.Integration.GallioTestFramework.RunTests(TestTaskOutput output, TestExecutionMapSet testMapSet, TestExecutionParameters parameters)
at nCrunch.TestExecution.TestRunnerThread.()
at nCrunch.TestExecution.TestRunnerThread.()
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()

Remco
#2 Posted : Wednesday, March 11, 2015 1:42:41 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for sharing this.

This is behaviour as designed. NCrunch enforces a default timeout for all tests to prevent them from hanging up the pipeline. It's very configurable - see here for more information.
CoolBreeze
#3 Posted : Wednesday, March 11, 2015 7:20:48 PM(UTC)
Rank: Advanced Member

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

Was thanked: 9 time(s) in 9 post(s)
Hi,

I added the NCurnch timeout attribute and that appeared to solve my problem.

But the test timed out by hitting the default MbUnit test timeout limit.

So here's a complete step-by-step solution:

1. Use NuGet to download and install the NCrunch.Framework into your solution.

2. Add Import NCrunch.Framework to your code.

3. Add NCrunch Timeout attribute to your test function:

<NCrunch.Framework.Timeout(1000 * 60 * 60)> _

4. Add MBunit (or your favorite test framework's Timeout attribute) to your test function:

<MbUnit.Framework.Timeout(60 * 60)> _

Final code snippets:

Imports NCurnch.Framework

Private Const m_TimeOutMBUnit As Integer = 60 * 60
Private Const m_TimeOutNCrunch As Integer = 1 * 1000 * m_TimeOutMBUnit

<Test()> _
<NCrunch.Framework.Timeout(m_TImeoutNCrunch)> _
<MbUnit.Framework.Timeout(m_TImeOutMBUnit)> _
Public Sub CreateApp(<Factory("CreateAppFactory")> TestObj As TEST_BD_WebUI_NewApplication_Basic)



Thanks!

Ed
1 user thanked CoolBreeze for this useful post.
Remco on 3/11/2015(UTC)
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.079 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download