xcodebuild - App accessibility isn't loaded

Originator:bartosz.janda
Number:rdar://29399432 Date Originated:28.11.2016
Status:Duplicate/30058330 Resolved:No
Product:Developer Tools Product Version:Version 8.1 (8B62)
Classification:Serious Bug Reproducible:Always
 
When executing UI Automation tests, by using xcodebuild command, around test 170 - 180 executions fails due an error:

>     t =     6.05s             Wait for app to idle
>     t =   126.71s                 App event loop idle notification not received, will attempt to continue.
>     t =   126.71s                 App animations complete notification not received, will attempt to continue.

All next test cases will not execute and all will have this error message:

>     t =     4.43s             Waiting for accessibility to load
>     t =    64.65s                 Assertion Failure: testUITests.swift:21: UI Testing Failure - App accessibility isn't loaded

This issue also exists if the tests were started from Xcode. Issue may be similar to 29393034, where (probably) some resources are not released after tests.

Steps to Reproduce:
1. Using terminal go to folder where the attached project was extracted
2. Execute UI tests using:
xcodebuild -project test.xcodeproj -scheme test -destination "platform=iOS Simulator,name=iPhone 6s,OS=10.1" test
3. Tests should fail after `testExample70`

or:

1. Open attached project using Xcode.
2. Run tests on scheme test.
3. Tests should fail after `testExample70`

Expected Results:
All test should be executed and finished

Actual Results:
After reaching test (around) 170 all next tests are failing due assertion "App accessibility isn't loaded"

Version:
masOS Sierra 10.12.1 (16B2555)
Xcode 8.1 (8B62)

Notes:
I've attached logs from xcodebuild command, Xcode and compressed project with tests.

Comments

App accessibility isn't loaded after 205 tests.

App event loop idle notification not received, will attempt to continue. App animations complete notification not received, will attempt to continue. Assertion Failure: :0: failed: Timed out waiting for key event to complete

205 tests get passed in our suite of 298 tests. The above errors start appearing for the 206th test. All the rest of the tests fail with the below error.

Assertion Failure: :0: App accessibility isn't loaded

This is reproduced every day when we run our test suite. *Tested with Xcode 9.0 beta 4,5 and 6

+1 Same issue. After reaching UI test (around) 170 all next tests are failing due assertion "App accessibility isn't loaded"

+1 Same happens to me. But for the first test. I recreated the XCUITests target and the scheme, deleted DerivedData, cleaned the project, reset all simulators. Nothing helps.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!