views:

1623

answers:

5

So I have some unit tests that pass in Xcode 3.1 / Leopard. These use SenTestingKit in an iPhone app project and are built/run in a separate "Test" target. I just upgraded to Xcode 3.2 on Snow Leopard and the tests seem to run (I get logs in Console.app and see them passing), but Xcode beachballs and must be force quit'd after they are run. Console.app displays the following error from Xcode, which appears even if no test cases are included in the Test target:

Xcode[1734] -[XCBuildLogCommandInvocationSection setTestsPassedString:]:
                unrecognized selector sent to instance 0x20104db60

Xcode[1734] -runOperationInBackground raised an exception: 
                 -[XCBuildLogCommandInvocationSection setTestsPassedString:]:
                 unrecognized selector sent to instance 0x20104db60

I've cleaned and re-built to no avail, and I can't seem to find anything on this topic by searching (although it does seem one person has the same issue).

Update: I have reported this as a bug to Apple with bug #7214051.

+2  A: 

Sounds like corruption; maybe your Xcode installation is bad or maybe something got hosed when you installed Snow Leopard.

Or maybe your project is hosed somehow.

If you have access to another Snow Leopard machine, give it a test there. If it still crashes, file a bug via http://bugreport.apple.com/

bbum
Just tried it out on another Snow Leopard machine and it does the exact same thing; also added a new project with a Test target and a simple test with the same outcome. Thanks for the suggestions!
Taylor Hughes
Wow. That ain't good -- please file a bug view http://bugreport.apple.com/ and attach your test project. Something is wonk on your machine (many folks live by Unit Tests in the same fashion), but Xcode should fail more gracefully. Feel free to ammend the bug# here.
bbum
+1  A: 

Me too experiencing same thing. After i failed to run mu old project(which was developed in leopard and Xcode 3.1) I tried creating a new project in Xcode 3.2 and added a new target for unit testing, added new files and a dummy case, again Xcode hanged.... no other option, i had to force quit it.

Kiran
OK -- definitely not good. Bug # please?
bbum
Can you sample Xcode when it hangs and attach the samples to the bug?
bbum
BTW I can't login to the Apple bug reporter. I have filed a "login problem" bug to that effect. :) In the meantime, here's a sample of the hung Xcode process: http://dump.taylor-hughes.com/xcode_hung_sample.txt Perhaps that gives some insight?
Taylor Hughes
+6  A: 

I have also filed a bug report for this, 7210948. Still no response from Apple which is disheartening.

--

Updated:

A user on the Apple Developer forums posted a workaround -

We have recently discovered the root cause of this problem.

People who are affected can work around it by (I hope you're ready for this)...

...changing the Time Zone on your Build machine away from Central Daylight Time. (In six >weeks you can change it back, and people in Mountain Standard TIme will be affected.)

No, seriously. Give it a try.

Message was edited by : cde at 3:34 PM

Aaron D.
Amazing, this actually works for me. I am stunned. Thanks!
Taylor Hughes
Apparently it's due to a mistake in a regular expression statement determining how long the test has been running. "cde" seemed to work for Apple but couldn't give any idea on when it would be fixed.
Aaron D.
Xcode 3.1.2 fixes this issue - thank you Apple!
Aaron D.
+1  A: 

per this link http://www.artin.org/geekblog/2009/09/xcode-snow-leopard-logical-unit-tests-hanging/

changing your Timezone to PST resolves this.

Interestingly, I have this problem on my macbook pro, but not on my mac pro.

Jeff Schilling
+1  A: 

One other issue to watch out for (although arguably not the issue of OP) is if your unit test bundle is hosted in a test rig (your app) and their is an issue with application initialization, your tests will hang.

There's a rdar for this: rdar://7333645 which suggests not init'ing NSApplicationMain

Diagnosis for this is to do a build. If it hangs, stop the build.

Manually attempt to execute the app (Cmd-Option-R or Cmd-Option-Y) - if you're app doesn't come up, check the console.

Jeff Schilling