简体   繁体   English

单元测试期间Xcode CI bot错误(Unexpected TestSuiteWillFinish)

[英]Xcode CI bot errors during unit testing (Unexpected TestSuiteWillFinish)

We recently set up some Xcode bots with an iOS app to automatically build and test an app I'm working on. 我们最近使用iOS应用程序设置了一些Xcode机器人 ,以自动构建和测试我正在处理的应用程序。 If I do just build and analyze, the build process works fine. 如果我只是构建和分析,构建过程工作正常。 If I set it to run tests, it ends up with a variable amount of errors that end with Unexpected TestSuiteWillFinish . 如果我将其设置为运行测试,则最终会出现可变数量的错误,这些错误以Unexpected TestSuiteWillFinish结尾。 For example, the most recent run showed: 例如,最近一次运行显示:

Run test suite TimeClockTestCase encountered an error (Unexpected TestCaseDidFinish) testParseResponseString encountered an error (Unexpected TestSuiteWillFinish) testGetIntegrationID encountered an error (Unexpected TestSuiteWillFinish) 运行测试套件TimeClockTestCase遇到错误(Unexpected TestCaseDidFinish)testParseResponseString遇到错误(Unexpected TestSuiteWillFinish)testGetIntegrationID遇到错误(意外的TestSuiteWillFinish)

And the one before that had just one error: 之前的那个只有一个错误:

testAddChildObjectTypeTimeClockEvent encountered an error (Unexpected TestSuiteWillFinish) testAddChildObjectTypeTimeClockEvent遇到错误(意外的TestSuiteWillFinish)

The integration results show all tests as passed, no matter what errors are displayed. 无论显示什么错误,集成结果都会显示所有测试都已通过。 If I run the tests directly via Xcode (instead of running the bot on the server), there are no errors and the same number of tests are passed. 如果我直接通过Xcode运行测试(而不是在服务器上运行bot),则没有错误并且传递相同数量的测试。

What causes these errors and how can I eliminate them? 导致这些错误的原因是什么?如何消除它们?


These are the logs from the TimeClockTestCase: 这些是来自TimeClockTestCase的日志:

Test Suite 'TimeClockTestCase' started at 2014-02-23 23:11:09 +0000
2014-02-23 18:11:09.653 -0500 [TimeClockResponseCommand parseResponseString] [Line 74] W: Unsupported action number "3" in TIMECLOCK response command

Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockEvent]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' started.
Test Case '-[TimeClockTestCase testAddChildObjectTypeTimeClockMode]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockEventColl]' started.
Test Case '-[TimeClockTestCase testTimeclockEventColl]' passed (0.000 seconds).
Test Case '-[TimeClockTestCase testTimeclockModeColl]' started.
Test Case '-[TimeClockTestCase testTimeclockModeColl]' passed (0.000 seconds).
Test Suite 'TimeClockTestCase' finished at 2014-02-23 23:11:09 +0000.

I got the same random behavior. 我得到了相同的随机行为。 I was able to identify that I was making an Asynchronous call, and testing it, was what caused this random Unexpected TestSuiteWillFinish . 我能够确定我正在进行异步调用,并对其进行测试,这是导致这种随机的Unexpected TestSuiteWillFinish

As I'm using Kiwi , what I did is to wait a little bit the end of the asynchronous call like indicated here ( https://github.com/allending/Kiwi/wiki/Asynchronous-Testing ) for those specicfic asynchronous calls. 当我使用Kiwi ,我所做的是等待一些异步调用的结束,如此处所示( https://github.com/allending/Kiwi/wiki/Asynchronous-Testing ),用于那些特定的异步调用。

Hope this help! 希望这有帮助!

We had the same issue of Unexpected TestSuiteWillFinish calls causing tests to abort. 我们遇到了与Unexpected TestSuiteWillFinish调用相同的问题导致测试中止。 In our case, it was due to excessive debug logging. 在我们的例子中,这是由于过多的调试日志记录。 Disabling our logging caused tests to pass reliably again. 禁用我们的日志记录导致测试再次可靠地传递。

That wouldn't seem to be the cause of your issue, but maybe it's a hint? 这似乎不是你问题的原因,但也许这是一个暗示?

My offhand guess is that the XCTest runner has some kind of timeout. 我的随意猜测是XCTest跑步者有某种超时。 So check that your test executes in a timely manner? 那么检查你的测试是否及时执行?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM