5

I setup a jenkins job for my iOS project. The host target runs smoothly while the unit test target failed on a very strange reason given by "jenkins console output" as below:

[DEBUG] Test Case '-[WhereYouAreTests testShowMainTopbar]' started. Test Case '-[WhereYouAreTests testShowMainTopbar]' passed (0.000 seconds). FATAL: Log statements out of sync: current test case was null Build step 'XCode' marked build as failure Finished: FAILURE

For the fake of clear, WhereYouAre is my "host target" and WhereYouAreTests is, of course, the unit test target. I DO have googled everywhere before I raised this question. The only one clue is here: http://baolei.tumblr.com/, in which it says:

getschh asked: Hi Bao. I tried your approach concerning ios unit-testing with xcode 4.5 and ios 6 with the ruby script. I reconfigured the jenkins job. First I thought: wow, this works great. When I took a close look at it, i found a big problem. I always get the following error: FATAL: Log statements out of sync: current test case was 'testBarcodeUtilWithCorrectValues'. It always happens with a different Unit-Test. The result of this error: After the error occurs, no more unit-tests are testet. What can I do?

Does it work when you run the script on a local machine (instead of through Jenkins)? If not, maybe you can try create a brand new project with just one simple test case, and use the script. If you can get a new project working fine, you can then try commenting out most of the test cases in your real project, leaving only a few tests, and see what happens. iOS test setup is finicky sometimes you really have to experiment a lot to get everything working smoothly.

My unit test runs very well within Xcode. So it obviously doesn't help me out.

Please someone advice me a way or any clues. Thanks in advance.

BTW, my environments configured for this: OS 10.7 XCode 4.6 Jenkins (brew install package) 1.5

  • 1
    I have the same issue, let's hope someone resolves this... – Gligor Feb 04 '13 at 23:31
  • It seems this is being caused by the Jenkins Xcode plugin being unable to parse the output of the test. This is happening to me because for some reason running tests under ios-sim causes `[DEBUG]` to be printed at the beginning of each output line. I haven't been able to figure out why this is happening yet. – Alex Pretzlav Mar 07 '13 at 17:34

2 Answers2

0

I've patched Jenkins Xcode plugin to parse the lines with [DEBUG] in start just fine (and in general made it more lenient):

https://github.com/jenkinsci/xcode-plugin/pull/19

Hopefully you find it useful.

Vlad Grichina
  • 1,059
  • 8
  • 16
0

I faced the same issue and managed to resolve it by doing a Erase all contents and settings on the simulator, then trigger the build again.

https://medium.com/@lawrey/fixing-fatal-log-statements-out-of-sync-current-test-case-was-null-in-jenkins-xcode-f14c8b117641

Lawrence Tan
  • 507
  • 2
  • 12