After updating to Compose 1.2 we have a ton of fla...
# compose
j
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
@Jan Skrasek Did you ever find a workaround for this?
j
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:
Copy code
@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
Thanks. I managed to reproduce it after a few iterations, dump linked int he ticket
j
If you have any code/minimal repro I think they could utilize it for the fix.
483 Views