Fix unit test host crash on iOS 27 by adopting the UIScene life cycle - #25930
Merged
Conversation
iOS 27 removed the legacy window life cycle, so the unit test host's plain UIWindow() crashed at launch with "UIScene life cycle is required for apps built with this SDK" before the test runner could connect. This blocked every app-hosted (WordPressTest) suite on iOS 27 while the same binary ran on iOS 26.5. TestingAppDelegate now opts into the scene life cycle the same way WordPressAppDelegate does, vending a minimal TestingSceneDelegate that builds the host window in scene(_:willConnectTo:). The window shows a SwiftUI "Running unit tests" placeholder. Verified the previously crashing suites pass on both iOS 27 and iOS 26.5.
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33922 | |
| Version | PR #25930 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | ff879ae | |
| Installation URL | 4rg81t3krg58g |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33922 | |
| Version | PR #25930 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | ff879ae | |
| Installation URL | 5e9vkbk1e9v50 |
crazytonyli
enabled auto-merge
August 23, 2026 08:14
jkmassel
approved these changes
Aug 24, 2026
jkmassel
left a comment
Contributor
There was a problem hiding this comment.
nit:
mentions "never connects a window scene", which IINM this PR makes incorrect.The unit test host adopted the UIScene life cycle, so the delegate-window fallback no longer covers it. Drop the stale claim that the test host never connects a window scene.
crazytonyli
enabled auto-merge
August 24, 2026 21:55
Contributor
Author
|
@jkmassel Good catch! Updated in the latest commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


iOS 27 removed the legacy window life cycle, so the unit test host's plain UIWindow() crashed at launch with "UIScene life cycle is required for apps built with this SDK" before the test runner could connect. This blocked every app-hosted (WordPressTest) suite on iOS 27 while the same binary ran on iOS 26.5.
TestingAppDelegate now opts into the scene life cycle the same way WordPressAppDelegate does, vending a minimal TestingSceneDelegate that builds the host window in scene(_:willConnectTo:). The window shows a SwiftUI "Running unit tests" placeholder. Verified the previously crashing suites pass on both iOS 27 and iOS 26.5.