square / workflow-kotlin

A Swift and Kotlin library for making composable state machines, and UIs driven by those state machines.

Home Page:https://square.github.io/workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI Test shards are flaky, perhaps interfering with each other?

rjrjr opened this issue · comments

We all know that our UI shards have gotten unbearably flaky again, but are having trouble articulating exactly what the symptoms are. This time around it feels less lack bad espresso code and more like infrastructure, for what that's worth.

Let's use the issue to take notes each time we're afflicted and see if we can tease out a pattern.

For example, #1105 added a new test class but did not invoke it. Making no changes to code that would be executed in CI. But yet the instrumentation shards all failed? Such as https://github.com/square/workflow-kotlin/actions/runs/6051263654.

We have no idea why they fail - but they look like legit timeouts on espresso, so are the emulators freezing/lagging?

Maybe we have some good old espresso root matcher issues? Maybe a system dialog was popped? This would be easier to dig into if we had screen grabs or video. And if I had a pony.

com.squareup.workflow1.ui.container.BackStackContainerPersistenceLifecycleTest > restores_view_on_pop_after_config_change[test(AVD) - 10] FAILED 
	androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
	Root{application-window-token=android.view.ViewRootImpl$W@8a45edf, window-token=android.view.ViewRootImpl$W@8a45edf, has-window-focus=false, layout-params-type=1, layout-params-string={(0,0)(fillxfill) sim={forwardNavigation} ty=BASE_APPLICATION wanim=0x10302fe