Some of my unit tests tests are not finishing in XCode 4.4 Some of my unit tests tests are not finishing in XCode 4.4 xcode xcode

Some of my unit tests tests are not finishing in XCode 4.4


I am on XCode 4.5.2. For application unit test, if your test suites finish so quick that the main application is not correctly loaded before that, you will get the warning. You can simply avoid the problem by adding a sleep at the end of your test like following. It doesn't happen for logic unit test.

 [NSThread sleepForTimeInterval:1.0];


I've just had this problem with XC4.5DP4.

I had a test which does some work in a loop, and does nothing else when it falls out of the loop, and I was getting the "did not finish" error.

In an attempt to prove that the test was finishing, I added this as the very last line:

NSLog(@"done");

Not only does "done" get printed to the output - now Xcode says that the test has finished.

Seems to be a workaround... go figure.


I'm using XCode46-DP3 and I've just resolved this problem in my tests. I've several tests that start a web server and then execute http call to it; at the end of the test the web server is stopped. In last week these tests have begun to have the warning 'did not finish'.For me has been enough to add the following sleep at the end of these tests (precisely I've added it in the tearDown):

- (void)tearDown {  [self.httpServer stop];  [NSThread sleepForTimeInterval:1.0];  self.httpServer = nil;  self.urlComposer = nil;}