Skip to content

test(android): let E2E node waits span activity switches - #755

Draft
dcalhoun wants to merge 1 commit into
trunkfrom
test/fix-android-e2e-activity-switch-race
Draft

dcalhoun wants to merge 1 commit into
trunkfrom
test/fix-android-e2e-activity-switch-race

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Oct 2, 2026

Copy link
Copy Markdown
Member

What?

Why?

How?

Testing Instructions

Accessibility Testing Instructions

Screenshots or screencast


AI-generated details

Fixes one of two Android E2E flakes: IllegalStateException: No compose hierarchies found from navigateToEditor (trunk builds 3071, 3051, 2844).

  • Tapping "Standalone editor" pauses MainActivity ~30–50ms before SitePreparationActivity resumes. Compose tests only track resumed roots, so a poll landing in that gap finds none.
  • fetchSemanticsNodes() defaults to atLeastOneRootRequired = true and throws there; waitUntil doesn't retry thrown errors. Passing false lets the poll keep waiting, as Compose's own waitUntilAtLeastOneExists does.
  • The other flake (instrumentation "Process crashed", builds 3070, 3046, 3010) is unrelated: Play services restarts on the freshly wiped emulator kill the app. Not addressed here.

Verified :app:compileDebugAndroidTestKotlin and make lint-android; CI's Android E2E step exercises the change.

🤖 Generated with Claude Code

waitForNode polled with fetchSemanticsNodes()'s default
atLeastOneRootRequired, which throws when no Compose root is resumed.
Tapping into the next activity opens that gap briefly, and waitUntil
doesn't retry thrown errors, so "No compose hierarchies found" failed
navigateToEditor intermittently on CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dcalhoun dcalhoun added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Oct 2, 2026
@wpmobilebot

Copy link
Copy Markdown

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/755")

Built from b411908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants