https://kotlinlang.org logo
Title
j

Jan Skrasek

07/19/2022, 11:38 AM
After updating to Compose 1.2 we have a ton of flaky UI tests (end-to-end tests). •
Test instrumentation process crashed.
app simply stops responding to some focus event and then instrumentation timeouts after 5 seconds, what's more, the interaction is on non-compose view at this particular time. •
java.lang.IllegalStateException: No compose hierarchies found in the app. Possible reasons include ...
suddenly this started happening, but not always - probably tests access activity too early, seems like idling resource issue, but this was not happening at all before update • Compose recomposing forever - timeouting because not able to reach an idle state - this was only issue I was able to fix - we were missing
remember
, but actually without UI test no repeated recomposition was happening there Do you any similar experience, tips where to look for issues/errors/fixes?
😢 1
p

Paul Woitaschek

10/27/2022, 9:25 AM
@Jan Skrasek Did you ever find a workaround for this?
j

Jan Skrasek

10/27/2022, 9:28 AM
Just yesterday we have updated to Compose 1.3 which seems to fix (🙏) the
Test instrumentation process crashed.
The
No compose hierarchies found in the app.
seems to be fixed (don't know why) by this particular change I did yesterday: • we were using createEmptyComposeRule for our full end-to-end UI tests that were using own ActivityAscenarioRule. • I've replaced createEmptyComposeRule with this:
@get:Rule
  val composeTestRule = AndroidComposeTestRule(activityTestRule) {
    error("Can't provide current activity")
The activityTestRule is the activity scenario rule we had there for the whole time.
p

Paul Woitaschek

10/27/2022, 9:42 AM
Thanks. I managed to reproduce it after a few iterations, dump linked int he ticket
j

Jan Skrasek

10/27/2022, 9:44 AM
If you have any code/minimal repro I think they could utilize it for the fix.