UI Tests seem to be broken when run on an iPhone running iOS 15.4.
Steps to reproduce:
Create a fresh app project in Xcode 13.3 including UI tests
Select an attached iPhone running iOS 15.4
Run the UI test testExample which only starts the app, nothing more.
Restart the attached phone
Try to run testExample again.
Expectation:
Test succeeds again
Actual:
When launching the app, XCTest is internally first trying to terminate the app and gets stuck. After 60s the tests fail.
Logging (app id and home folder are removed for privacy reasons):
TESTUITests-Runner[341:7025] Running tests...
Test Suite 'Selected tests' started at 2022-03-17 14:53:36.855
Test Suite 'TESTUITests.xctest' started at 2022-03-17 14:53:36.855
Test Suite 'TESTUITests' started at 2022-03-17 14:53:36.856
Test Case '-[TESTUITests.TESTUITests testExample]' started.
t = 0.00s Start Test at 2022-03-17 14:53:36.856
t = 0.07s Set Up
t = 0.07s Open <app_id>.TEST
t = 0.11s Launch <app_id>.TEST
t = 0.11s Terminate <app_id>.TEST:269
<UserHome>/Workspace/TEST/TESTUITests/TESTUITests.swift:28: error: -[TESTUITests.TESTUITests testExample] : Failed to terminate <app_id>.TEST:269: Failed to terminate <app_id>.TEST:0
t = 60.29s Tear Down
Test Case '-[TESTUITests.TESTUITests testExample]' failed (60.294 seconds).
Test Suite 'TESTUITests' failed at 2022-03-17 14:54:37.150.
Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.294) seconds
Test Suite 'TESTUITests.xctest' failed at 2022-03-17 14:54:37.150.
Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.295) seconds
Test Suite 'Selected tests' failed at 2022-03-17 14:54:37.151.
Executed 1 test, with 1 failure (0 unexpected) in 60.294 (60.296) seconds
If I manually start the app once, then the UI tests will run again afterwards for a while (including restarting the app). At some point they get stuck again and we are not sure why, yet. This makes it really hard to run tests in our CI because we can't keep sending someone into the server room to manually start the app...
Has anybody else encountered this and found a solution?
It works fine on iOS 15.1.1.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The following tech note describes under which situations bluetooth state restoration can occur: https://developer.apple.com/documentation/technotes/tn3115-bluetooth-state-restoration-app-relaunch-rules
But does it also occur when the app is updated, as in the following scenario?
Try to connect to a peripheral
app got terminated by the OS to free up memory
app is updated from the app store
peripheral starts advertising