Error using Async Test Case #49

Closed
CMoebius opened this Issue Jun 20, 2011 · 6 comments

Projects

None yet

4 participants

My test subclasses the GHAsyncTestCase and I am using this code to wait for the test to notify success:

[self waitForStatus:kGHUnitWaitStatusSuccess timeout:60.0];

Problem is, if the test fails and no SUCCESS notify is called, I get this stack trace and the app ends:

2011-06-20 10:25:24.318 GHUnitTests[2190:207]
Name: GHTestFailureException
File: /Users/gabe/Projects/gh-unit/Classes/GHAsyncTestCase.m
Line: 127
Reason: Request timed out
#0 0xf3658c __exceptionPreprocess() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#1 0x108a313 objc_exception_throw() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libobjc.A.dylib)
#2 0xf364e1 +NSException raise
#3 0x002872 +[DAISDiscoveryTest testDAISDiscovery](/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)
#4 0x0302b2 +[GHTesting runTestWithTarget:selector:exception:interval:reraiseExceptions:](/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)
#5 0x02c5d6 +[GHTest run:](/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)
#6 0x027462 +[GHUnitIPhoneTestViewController _runTest](/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)
#7 0x1884fd +UIApplication sendAction:to:from:forEvent:
#8 0x39acc3 +UIBarButtonItem _sendAction:withEvent:
#9 0x1884fd +UIApplication sendAction:to:from:forEvent:
#10 0x218799 +UIControl sendAction:to:forEvent:
#11 0x21ac2b +UIControl _sendActionsForEvents:withEvent:
#12 0x2197d8 +UIControl touchesEnded:withEvent:
#13 0x1acded +UIWindow _sendTouchesForEvent:
#14 0x18dc37 +UIApplication sendEvent:
#15 0x192f2e _UIApplicationHandleEvent() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
#16 0x141a992 PurpleEventCallback() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices)
#17 0xf17944 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#18 0xe77cf7 __CFRunLoopDoSource1() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#19 0xe74f83 __CFRunLoopRun() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#20 0xe74840 CFRunLoopRunSpecific() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#21 0xe74761 CFRunLoopRunInMode() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation)
#22 0x14191c4 GSEventRunModal() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices)
#23 0x1419289 GSEventRun() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices)
#24 0x196c93 UIApplicationMain() (/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/UIKit.framework/UIKit)
#25 0x002673 main() (/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)
#26 0x0022e5 start() (/Users/chrismorris/Library/Application Support/iPhone Simulator/4.3.2/Applications/405D9506-6E4F-468D-A1EC-886A70A88E8E/GHUnitTests.app/GHUnitTests)

If I should be doing something differently, please let me know. Should I be calling [notify] with a kGHUnitWaitStatusFailure if the test fails? I did try this and the test does fail, but an exception is also produced. It would be nice not to see the exception. I know the [wait] method is designed to wait for either success or failure and throw an exception if the opposite is notified. Just not sure why the exception has to be seen.

epologee commented Oct 9, 2011

Did you find a solution to this issue? It seems nobody is really watching the issues on this list anymore...

CMoebius commented Nov 1, 2011

I gave up and switched to Google Toolbox for Mac. It doesn't have async tests, but it has a lot of support from others using it. I rolled my own wait loops using RunLoop methods. Not the best solution, but at least I don't have to wait for help that's never coming.

epologee commented Nov 1, 2011

I agree. I'm looking at switching to the regular SenTestingKit, although I totally liked the GHUnit better...

CMoebius commented Nov 1, 2011

You may want to take a look at GTM. It offers come nice extensions to Objective-C. Good luck!

Has anyone revisited this, I am having the same problem. It is like the other thread is never spawned. Gabriel help!!!!

Owner
x2on commented Nov 5, 2013

There was no new response since 2 years.
If the problem still exists please reopen this issue.

@x2on x2on closed this Nov 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment